UID2-6764: Add attestation_enabled opt-out to docker publish workflows#230
Merged
Conversation
Adds a boolean attestation_enabled input (default true) on the attest_image composite and pipes it through both shared docker publish workflows + the non-Java composite. Callers opt out with one line (attestation_enabled: false) instead of granting id-token / attestations / artifact-metadata permissions they don't otherwise need. Includes a throwaway .github/workflows/test-attest-opt-out.yaml that exercises both paths against a built-inline alpine image and asserts via external gh attestation verify that: - default: attestation exists, verify exits 0 - opt-out: no attestation exists, verify fails with "no attestations" Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Empty-attestation lookup returns "HTTP 404: Not Found" against the GitHub attestations API, not "no attestations found". Accept either. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Evidence permanent in run 25709336298 (both jobs green). Re-add ad-hoc if a future change to attest_image needs re-validation, mirroring the UID2-6764 precedent (test-attest-image.yaml lived only long enough to capture run 25542801315). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
attest_image is just the implementation — opt-out is a caller concern. Drop the input on the composite; the existing callers already had to gate on not_snapshot, so adding && inputs.attestation_enabled (workflow) or && inputs.attestation_enabled == 'true' (composite) keeps the gate where it belongs. Re-adds the smoke workflow (deleted in the previous commit) to verify the new caller-side gating pattern end-to-end. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jon8787
approved these changes
May 12, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a boolean
attestation_enabledinput (defaulttrue) on the two shared docker publish workflows and the non-Java composite, and uses it to gate the existingattest_imagestep via the caller'sif:. Theattest_imagecomposite itself is unchanged — it's the implementation; opt-out is a caller concern.Lets private consumers opt out with one line (
attestation_enabled: false) instead of grantingid-token: write+attestations: write+artifact-metadata: writepermissions they don't otherwise need.Default-on means public callers do nothing — the existing six rolled out in #228 continue working unchanged.
Files
actions/attest_image/action.yamlactions/shared_publish_to_docker/action.yamlattestation_enabledinput (default'true'); ANDed into the existingif: inputs.not_snapshot == 'true'on theattest_imagestep.github/workflows/shared-publish-to-docker-versioned.yamlattestation_enabled: type: boolean, default: trueworkflow input; piped to the composite.github/workflows/shared-publish-java-to-docker-versioned.yamlattest_imagestep'sif:Smoke test evidence
Ran on a throwaway
.github/workflows/test-attest-opt-out.yaml(since deleted; following the UID2-6764 precedent wheretest-attest-image.yamllived only long enough to capture run 25542801315). Two jobs simulate the caller-side gating pattern: each builds + pushes a throwaway alpine image, gates a call to./actions/attest_imageonenv.ATTEST_ENABLED == 'true', then externally verifies the expected outcome.Run 25710314847 — both jobs green:
default-enabled(ATTEST_ENABLED=true):ghcr.io/iabtechlab/uid2-shared-actions/test-attest-optout-default@<digest>Call attest_image (gated, expect runs)step executed (theif:was true)gh attestation verify --owner IABTechLab --signer-repo IABTechLab/uid2-shared-actions→ exit 0Default behavior confirmed: attestation present, verify succeeded.opted-out(ATTEST_ENABLED=false):ghcr.io/iabtechlab/uid2-shared-actions/test-attest-optout-disabled@<digest>Call attest_image (gated, expect skipped)step skipped (visible as a dash in the run summary)gh attestation verifyreturnedError: HTTP 404: Not Found (https://api.github.com/orgs/IABTechLab/attestations/sha256:...)confirming no attestation was createdOpt-out confirmed: no attestation present, verify failed as expected.How private consumers will use this
Drop one line into the calling job's
with:block (instead of grantingid-token/attestations/artifact-metadataperms):Test plan
gh attestation verify(run 25710314847)v3(release +update-major-version-tags.yaml) so consumers can use the new inputuid2-validatoranduid2-alb-log-processorperm-PRs being filed under UID2-6764 follow-upLinked: UID2-6764 (follow-up to #228)
🤖 Generated with Claude Code