Skip to content

ci(release): sign-release.sh should prefer a decdn.org key before gpg's default key #2391

Closed

Description

@thiras

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:

  1. Secret keys that have a uid ending in @decdn.org and are published in KEYS.
    • 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.
  2. 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, so decdn.org.example and 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_KEY and a keyring holding a personal key plus one @decdn.org key from KEYS, the script signs with the @decdn.org key regardless of keyring order.
  • Two matching @decdn.org keys → the script dies with both fingerprints listed.
  • No @decdn.org key → the one secret key published in KEYS is 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_KEY row 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.

Activity

  1. added
    kind:feature
    github_actions
    on Oct 9, 2026
  2. self-assigned this
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

github_actionskind:feature

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions