ci: fix sign-image.yaml mode detection + self-verify identity (RFC-044.4 WS3a)#27
Merged
Merged
Conversation
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.
What
Fixes two bugs in the embedded
sign-image.yaml, both found by a validationworkflow_dispatchof challenger's build (the build succeeded; the sign job failedwith
no images to sign).Mode selection used
github.event_name. In aworkflow_callreusable,github.event_nameinherits the caller's trigger (e.g.workflow_dispatchor atag
push), so the build-path call was misrouted into the re-sign branch, foundrefsempty, and exited 1. Now it selects mode by which input is set:refs-> re-sign, elsedigest+tags-> build-sign.Self-verify identity used
github.ref. Also inherited from the caller, so atag release would self-verify against
@refs/tags/vX.Y.Zwhile the real keylessSAN is
@refs/heads/main(callers reference the signer@main; the re-signdispatch runs on the default branch). Pinned the verify identity to
@refs/heads/main, which is what the@mainreference produces and the only refthe Kyverno enforce IVP accepts.
No interface change; both
workflow_call(build) andworkflow_dispatch(re-sign)paths keep working.
Test plan
docker.yml: build + sign both succeed.cosign verifythe pushed digest against.../sign-image.yaml@refs/heads/mainpasses.