Repository navigation
Description
Problem
When DECDN_SIGNING_KEY is unset, .github/scripts/sign-release.sh picks the first secret key in the maintainer's personal keyring:
mapfile -t SECRET_FPRS < <(
gpg --list-secret-keys --with-colons ${SIGNING_KEY:+"$SIGNING_KEY"} 2>/dev/null |
awk -F: '/^sec:/ {want = 1} /^fpr:/ && want {print $10; want = 0}'
)
...
FPR="${SECRET_FPRS[0]}"A maintainer's keyring usually holds a personal key as well as their @decdn.org key, and every key in KEYS carries a decdn.org uid ([email protected], [email protected]). If the personal key sorts first, the script selects it and then dies at the KEYS check ("signing key … is not published in KEYS"). The maintainer must then set DECDN_SIGNING_KEY by hand on every run. RELEASING.md documents this as the workaround (DECDN_SIGNING_KEY — "key to sign with, when your default key is not the one in KEYS").
Proposal
When DECDN_SIGNING_KEY is unset, resolve the key in this order:
- Secret keys that have a uid ending in
@decdn.organd are published inKEYS.- Exactly one → use it.
- More than one → die and list them, like the existing ambiguity check for
DECDN_SIGNING_KEY. Do not take the first.
- No such key → the one secret key that is published in
KEYS, whatever its uids. None or several → die and list them. Do not take whichever key gpg lists first. (Revised during review of ci(release): prefer a decdn.org key from KEYS in sign-release.sh #2393: the old "gpg's default key" fallback let keyring order choose between two published keys, e.g. during a key rotation.)
DECDN_SIGNING_KEY, when set, keeps priority over both steps.
Notes:
- Match on the uid email domain from
--with-colons(field 10), not a loose substring, sodecdn.org.exampleand similar do not match. - Skip revoked/expired keys and uids (validity field
r/e). - Print which rule picked the key (e.g.
==> Signing as <fpr> (decdn.org key from KEYS)), so the operator sees the choice before the passphrase prompt.
Acceptance
- With no
DECDN_SIGNING_KEYand a keyring holding a personal key plus one@decdn.orgkey fromKEYS, the script signs with the@decdn.orgkey regardless of keyring order. - Two matching
@decdn.orgkeys → the script dies with both fingerprints listed. - No
@decdn.orgkey → the one secret key published inKEYSis used; none or several → the script dies listing the fingerprints. (Revised in review of ci(release): prefer a decdn.org key from KEYS in sign-release.sh #2393.) - Script header comment and RELEASING.md's
DECDN_SIGNING_KEYrow describe the new default order.
publish-crates.sh is out of scope: it only verifies the tag signature and does not choose a signing key.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity