Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ on:
type: boolean
default: false
description: "Whether to publish images to Docker Hub"
sarif_ref:
required: false
type: string
default: ""
description: "Ref the container scans are filed under (default: the calling ref)"
outputs:
image:
description: "Full image reference with tag"
Expand Down Expand Up @@ -290,6 +295,8 @@ jobs:
with:
sarif_file: 'trivy-results.sarif'
category: 'container-scan-api'
ref: ${{ inputs.sarif_ref || github.ref }}
sha: ${{ github.sha }}

# Build Lambda container image
lambda:
Expand Down Expand Up @@ -418,3 +425,5 @@ jobs:
with:
sarif_file: 'trivy-lambda-results.sarif'
category: 'container-scan-lambda'
ref: ${{ inputs.sarif_ref || github.ref }}
sha: ${{ github.sha }}
4 changes: 4 additions & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ jobs:
# Set DOCKERHUB_PUBLISHING_ENABLED to 'true' in GitHub variables when ready to publish
# Supports: refs/tags/v*.*.* (releases) and refs/heads/release/* (hotfixes)
publish_to_dockerhub: ${{ vars.DOCKERHUB_PUBLISHING_ENABLED == 'true' && (startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/release/')) }}
# Prod deploys from a version tag, and code scanning only shows the
# default branch — filing prod's container scans under main makes those
# alerts describe what is deployed. Staging keeps its own ref.
sarif_ref: refs/heads/main
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
Loading