Skip to content

Commit a5f4823

Browse files
committed
require-signed-release: write the way forward on an unsigned verdict
An unsigned verdict rehearses instead of failing, but the notice names no concrete next step. The opt-in unsigned-guidance input puts the exact companion commands into the step summary: fetch the tag, sign the companion on the release commit, push it. The companion's name derives from the attestation-tags glob, so v*-sig suggests vX.Y.Z-sig and the default glob suggests <tag>-sig. Pipelines that print their own guidance keep the plain notice.
1 parent 82bb6b5 commit a5f4823

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

‎.github/actions/require-signed-release/action.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ inputs:
4545
automation and must never act on a draft.
4646
required: false
4747
default: "false"
48+
unsigned-guidance:
49+
description: >-
50+
"true": an unsigned verdict also writes the way forward into the step
51+
summary — the exact commands that create and push the signed companion
52+
on the release commit, its name derived from `attestation-tags`
53+
(v*-sig suggests vX.Y.Z-sig; the default glob suggests <tag>-sig).
54+
Off by default for pipelines that print their own guidance.
55+
required: false
56+
default: "false"
4857
attestation-tags:
4958
description: >-
5059
Glob another tag must match to count as an attestation (e.g. v*-sig).
@@ -110,6 +119,7 @@ runs:
110119
INPUT_ATTESTATION_TAG: ${{ inputs.attestation-tag }}
111120
INPUT_REQUIRE_PUBLISHED: ${{ inputs.require-published }}
112121
INPUT_ATTESTATION_TAGS: ${{ inputs.attestation-tags }}
122+
INPUT_UNSIGNED_GUIDANCE: ${{ inputs.unsigned-guidance }}
113123
INPUT_ACCEPT_RELEASE_TAG: ${{ inputs.accept-release-tag }}
114124
INPUT_ACCEPT_ATTESTATION_TAG: ${{ inputs.accept-attestation-tag }}
115125
INPUT_ACCEPT_SIGNED_COMMIT: ${{ inputs.accept-signed-commit }}

‎.github/actions/require-signed-release/require-signed-release.sh‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,27 @@ if [ "${INPUT_ACCEPT_SIGNED_COMMIT:-false}" = "true" ]; then
195195
fi
196196

197197
echo "::notice::no verified signature for ${TAG} on ${COMMIT} — sign the release tag, push a signed tag on that commit, or (opt-in) sign the commit; until then the registry step rehearses instead of uploading"
198+
199+
# Opt-in: put the way forward where the release manager is already
200+
# looking, with the companion's name derived from the attestation glob.
201+
if [ "${INPUT_UNSIGNED_GUIDANCE:-false}" = "true" ] && [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
202+
GLOB="${INPUT_ATTESTATION_TAGS:-*}"
203+
if [ "$GLOB" = "*" ]; then
204+
COMPANION="${TAG}-sig"
205+
else
206+
COMPANION="${GLOB/\*/${TAG#v}}"
207+
fi
208+
{
209+
echo "**Rehearsal only**: no verified signature covers \`${TAG}\` on \`${COMMIT}\`."
210+
echo ""
211+
echo "To publish, sign and push the companion on the release commit:"
212+
echo ""
213+
echo '```sh'
214+
echo "git fetch origin tag ${TAG}"
215+
echo "git tag -s -m '${TAG}' ${COMPANION} ${COMMIT}"
216+
echo "git push origin ${COMPANION}"
217+
echo '```'
218+
} >> "$GITHUB_STEP_SUMMARY"
219+
fi
220+
198221
write_outputs false "" "" "$COMMIT" "$TAG"

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com); releases are
88
### Added
99

1010
- `publish-dry-run` gains multi-crate release support: the expected version also derives from `<package>-vX.Y.Z` tags, and the new `require-deps-published` input fails a release tagged before its workspace path dependencies are live on crates.io, with an error naming the fix. The prep step now builds the `.crate` and pre-fetches its packaged lockfile, so the sealed offline verify-build resolves co-developed dependencies instead of failing even on a correctly ordered release, and the sealed step lists the shipped files via `cargo package --list`.
11+
- `require-signed-release` gains an opt-in `unsigned-guidance` input: an unsigned verdict also writes the way forward into the step summary — the exact commands that create and push the signed companion on the release commit, its name derived from `attestation-tags`. The `::notice::` alone stays the default for pipelines that print their own guidance.
1112

1213
## [1.6.1] - 2026-08-22
1314

0 commit comments

Comments
 (0)