Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,21 @@ jobs:
main:
runs-on: ubuntu-24.04
timeout-minutes: 30
outputs:
image: ${{ steps.image.outputs.name }}
digest: ${{ steps.release.outputs.digest }}
steps:
- name: Check out the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set image name
run: printf 'IMAGE=%s\n' "${GITHUB_REPOSITORY/docker-/}" >> "$GITHUB_ENV"
id: image
run: |
image="${GITHUB_REPOSITORY/docker-/}"
printf 'IMAGE=%s\n' "$image" >> "$GITHUB_ENV"
printf 'name=%s\n' "$image" >> "$GITHUB_OUTPUT"

- name: Set up QEMU
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
Expand Down Expand Up @@ -83,11 +90,34 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Report critical and high CVEs with Docker Scout
if: env.PUBLISH == 'true'
uses: docker/scout-action@b265cd48f8a1451d2680815b3e8dc4ed65ee16e7 # v1.30.0
scan:
name: Scan published image
needs: main
if: github.event_name != 'pull_request' && needs.main.outputs.digest != ''
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
security-events: write
steps:
- name: Check out the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Scan the published digest
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
version: v0.77.0
image-ref: ${{ needs.main.outputs.image }}@${{ needs.main.outputs.digest }}
scanners: vuln
severity: CRITICAL,HIGH
limit-severities-for-sarif: 'true'
exit-code: '0'
format: sarif
output: scan.sarif

- name: Upload scan results
uses: github/codeql-action/upload-sarif@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
command: cves
image: ${{ env.IMAGE }}@${{ steps.release.outputs.digest }}
only-severities: critical,high
exit-code: false
sarif_file: scan.sarif
Loading