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
24 changes: 4 additions & 20 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ on:
type: string
default: "[]"
description: "JSON array of alias image names published from the same build under every configured registry prefix"
scan:
required: false
type: boolean
default: false
description: "Scan each exact native platform image with Trivy before publishing it"
sign:
required: false
type: boolean
Expand Down Expand Up @@ -353,7 +348,7 @@ jobs:

- name: build+push
id: push-direct
if: ${{ !inputs.scan && inputs.additional-gar-registry == '' && inputs.expected-main-sha == '' && steps.registry.outputs.has-aliases != 'true' }}
if: ${{ inputs.additional-gar-registry == '' && inputs.expected-main-sha == '' && steps.registry.outputs.has-aliases != 'true' }}
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
with:
context: ${{ steps.paths.outputs.context }}
Expand All @@ -369,7 +364,7 @@ jobs:
${{ steps.metadata.outputs.primary-platform-ref }}

- name: Build native image for verified publication
if: ${{ inputs.scan || inputs.additional-gar-registry != '' || inputs.expected-main-sha != '' || steps.registry.outputs.has-aliases == 'true' }}
if: ${{ inputs.additional-gar-registry != '' || inputs.expected-main-sha != '' || steps.registry.outputs.has-aliases == 'true' }}
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
with:
context: ${{ steps.paths.outputs.context }}
Expand All @@ -384,19 +379,8 @@ jobs:
GIT_BRANCH=${{ steps.metadata.outputs.tag }}
tags: ${{ steps.metadata.outputs.local-image }}

- name: Scan exact native image
if: inputs.scan
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
image-ref: ${{ steps.metadata.outputs.local-image }}
format: table
exit-code: "1"
ignore-unfixed: true
severity: HIGH,CRITICAL
vuln-type: os,library

- name: Record directly pushed platform digest
if: ${{ !inputs.scan && inputs.additional-gar-registry == '' && inputs.expected-main-sha == '' && steps.registry.outputs.has-aliases != 'true' }}
if: ${{ inputs.additional-gar-registry == '' && inputs.expected-main-sha == '' && steps.registry.outputs.has-aliases != 'true' }}
env:
DIGEST: ${{ steps.push-direct.outputs.digest }}
PLATFORM: ${{ steps.vars.outputs.platform }}
Expand Down Expand Up @@ -430,7 +414,7 @@ jobs:

- name: Push verified native image
id: push-verified
if: ${{ inputs.scan || inputs.additional-gar-registry != '' || inputs.expected-main-sha != '' || steps.registry.outputs.has-aliases == 'true' }}
if: ${{ inputs.additional-gar-registry != '' || inputs.expected-main-sha != '' || steps.registry.outputs.has-aliases == 'true' }}
env:
ADDITIONAL_GAR_REGISTRY: ${{ inputs.additional-gar-registry }}
ADDITIONAL_IMAGE_NAMES: ${{ inputs.additional-image-names }}
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Set `additional-image-names` to a JSON array such as `["dash"]` when multiple pa

The publication modes are:

- The compatibility mode (`scan: false` and no `expected-main-sha`) may write a BuildKit registry cache while it pushes an attempt-specific native image.
- Compatibility mode (no `expected-main-sha`) may write a BuildKit registry cache while it pushes an attempt-specific native image.
- A scanned or main-tip-guarded build first loads the image locally. It may read `cache-from`, but it cannot export a registry cache or image until the scan and current-main check pass.
- `expected-main-sha` is checked immediately before each native image, final manifest, and signature write. This narrows the race but does not make two independent registries transactional.

Expand Down Expand Up @@ -215,7 +215,6 @@ jobs:
with:
image: example
additional-image-names: '["example-dashboard"]'
scan: true
sign: true
```

Expand Down
Loading