fix(release): make an unsigned release commit when git cannot sign

Before committing, release.sh now checks whether git can sign by running
a throwaway signed commit-tree. If that fails, because there is no
user.signingkey or no agent holds the key, the script warns and makes
the release commit with --no-gpg-sign. The success message now says
whether the commit is signed or unsigned. AGENTS.md is updated to match.
This commit is contained in:
Andras Bacsai
2026-11-09 18:17:11 +01:00
parent c9b9fd073b
commit 0d0f49b345
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -348,7 +348,7 @@ The summary reads as one sentence with the heading of its section, never in the
- A push that changes `release.json` publishes a release.
- NEVER edit `release.json` by hand. `scripts/release.sh` changes it.
- `scripts/plan-version.sh` shows what the current branch releases. `scripts/plan-version.sh --nightly` shows the next nightly.
- `scripts/release.sh` is interactive and makes a signed commit. Do not run it, push a release commit, or start the release or nightly workflow yourself. Give the user the commands from `RELEASE.md` for the release type:
- `scripts/release.sh` is interactive and makes a signed commit, or an unsigned commit when git cannot sign. Do not run it, push a release commit, or start the release or nightly workflow yourself. Give the user the commands from `RELEASE.md` for the release type:
| Release | Branch | Command |
| --- | --- | --- |
+7 -2
View File
@@ -214,8 +214,13 @@ update_version() {
commit() {
git add --all -- "$VERSION_FILE" CHANGELOG.md "$CHANGE_DIRECTORY"
git commit --quiet -S --message "feat(release): bump $ARTIFACT version to v$new_version"
ok "signed commit $DIM$(git rev-parse --short HEAD)$RESET $(git log -1 --format=%s)"
local sign=-S kind=signed
if ! git commit-tree -S -m 'release signing check' 'HEAD^{tree}' > /dev/null 2>&1 < /dev/null; then
sign=--no-gpg-sign kind=unsigned
warn "git cannot sign a commit (no user.signingkey, or no agent that holds the key), the release commit is unsigned"
fi
git commit --quiet "$sign" --message "feat(release): bump $ARTIFACT version to v$new_version"
ok "$kind commit $DIM$(git rev-parse --short HEAD)$RESET $(git log -1 --format=%s)"
}
push() {