-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: refactor scan workflow and update README badges
- Rename the job `scan-python` to `scan` in the scan workflow - Change the output file name and the artifact name from `trivy-results-python` to `trivy-results` - Remove the `scan-ubi` job from the scan workflow - Add a new separate workflow `scan_ubi` which includes the job removed from the scan workflow - Add the badge for the UBI image scan in the README file - Fix the alt text for the docker build and image scan badges in the README file Signed-off-by: 陳鈞 <[email protected]>
- Loading branch information
Showing
3 changed files
with
67 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
scan-python: | ||
scan: | ||
name: Scan Python official base image | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | ||
|
@@ -32,62 +32,12 @@ jobs: | |
template: "@.github/workflows/scan/html.tpl" | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
output: "trivy-results-python.html" | ||
output: "trivy-results.html" | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: trivy-results-python | ||
path: trivy-results-python.html | ||
name: trivy-results | ||
path: trivy-results.html | ||
retention-days: 90 | ||
|
||
scan-ubi: | ||
name: Scan Red Hat UBI base image | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
.github/workflows/scan/html.tpl | ||
sparse-checkout-cone-mode: false | ||
|
||
- name: Run Trivy vulnerability scanner for UBI image | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: "ghcr.io/jim60105/whisperx:ubi-no_model" | ||
vuln-type: "os,library" | ||
scanners: vuln | ||
severity: "CRITICAL,HIGH" | ||
format: "template" | ||
template: "@.github/workflows/scan/html.tpl" | ||
ignore-unfixed: true | ||
output: "trivy-results-ubi.html" | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: trivy-results-ubi | ||
path: trivy-results-ubi.html | ||
retention-days: 90 | ||
|
||
- name: Run Trivy vulnerability scanner for UBI image (SARIF) | ||
uses: aquasecurity/trivy-action@master | ||
if: always() | ||
with: | ||
image-ref: "ghcr.io/jim60105/whisperx:ubi-no_model" | ||
vuln-type: "os,library" | ||
scanners: vuln | ||
severity: "CRITICAL,HIGH" | ||
format: 'sarif' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
output: 'trivy-results.sarif' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
if: always() | ||
with: | ||
sarif_file: 'trivy-results.sarif' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: scan | ||
|
||
on: | ||
workflow_run: | ||
workflows: [docker_publish] | ||
types: [completed] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
scan-ubi: | ||
name: Scan Red Hat UBI base image | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
.github/workflows/scan/html.tpl | ||
sparse-checkout-cone-mode: false | ||
|
||
- name: Run Trivy vulnerability scanner for UBI image | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: "ghcr.io/jim60105/whisperx:ubi-no_model" | ||
vuln-type: "os,library" | ||
scanners: vuln | ||
severity: "CRITICAL,HIGH" | ||
format: "template" | ||
template: "@.github/workflows/scan/html.tpl" | ||
ignore-unfixed: true | ||
output: "trivy-results-ubi.html" | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: trivy-results-ubi | ||
path: trivy-results-ubi.html | ||
retention-days: 90 | ||
|
||
- name: Run Trivy vulnerability scanner for UBI image (SARIF) | ||
uses: aquasecurity/trivy-action@master | ||
if: always() | ||
with: | ||
image-ref: "ghcr.io/jim60105/whisperx:ubi-no_model" | ||
vuln-type: "os,library" | ||
scanners: vuln | ||
severity: "CRITICAL,HIGH" | ||
format: 'sarif' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
output: 'trivy-results.sarif' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
if: always() | ||
with: | ||
sarif_file: 'trivy-results.sarif' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters