Skip to content

Commit e890bf4

Browse files
author
Tyler Titsworth
authored
Add Caching to scan-container (#463)
Signed-off-by: tylertitsworth <tyler.titsworth@intel.com>
1 parent ec27d28 commit e890bf4

File tree

3 files changed

+12
-44
lines changed

3 files changed

+12
-44
lines changed

.github/scan/action.yml

-35
This file was deleted.

.github/workflows/container-ci.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,14 @@ jobs:
159159
- name: Pull Image
160160
run: docker pull ${{ secrets.REGISTRY }}/${{ secrets.REPO }}:${{ matrix.container }}
161161
- name: Scan Container
162-
uses: intel/ai-containers/.github/scan@main
162+
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # v0.28.0
163163
with:
164+
cache: true
165+
format: sarif
166+
github-pat: ${{ secrets.GITHUB_TOKEN }}
164167
image-ref: ${{ secrets.REGISTRY }}/${{ secrets.REPO }}:${{ matrix.container }}
165168
output: ${{ matrix.container }}-scan.sarif
169+
timeout: 30m0s
166170
- name: Cleanup
167171
if: always()
168172
run: docker rmi -f ${{ secrets.REGISTRY }}/${{ secrets.REPO }}:${{ matrix.container }}

.github/workflows/integration-test.yaml

+7-8
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,15 @@ jobs:
8888
id: summary
8989
shell: bash
9090
run: |
91-
SUMMARY=$(find . -maxdepth 3 -name '*summary.json' -print)
91+
SUMMARY=$(find . -maxdepth 1 -name '*summary.json' -print)
9292
if [[ -n "$SUMMARY" ]]; then
93-
echo "summary=$SUMMARY" >> "$GITHUB_OUTPUT"
94-
echo "Files matching the pattern test-runner-summary*.json found in the directory"
95-
summary_dir=$(dirname "$SUMMARY")
96-
jq -s '[.[] | .[]]' $summary_dir/*summary.json > combined.json
93+
echo "summary=true" >> $GITHUB_OUTPUT
94+
echo "Files matching the pattern ./*summary.json"
95+
jq -s '[.[] | .[]]' ./*summary.json > combined.json
9796
echo "Files found in the directory"
9897
else
99-
echo "summary=false" >> "$GITHUB_OUTPUT"
100-
echo "No files matching the pattern test-runner-summary*.json found in the directory"
98+
echo "summary=false" >> $GITHUB_OUTPUT
99+
echo "No files matching the pattern ./*summary.json"
101100
fi
102101
- name: Generate TXT file
103102
if: ${{ steps.summary.outputs.summary != 'false' }}
@@ -118,7 +117,7 @@ jobs:
118117
fi
119118
} >> output.txt
120119
- name: PR-comment
121-
if: ${{ steps.summary.outputs.summary == 'true' }}
120+
if: ${{ steps.summary.outputs.summary != 'false' }}
122121
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
123122
with:
124123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)