Skip to content

Add GPG signing key preflight verification job to CI - #138

Merged
bernardladenthin merged 2 commits into
mainfrom
claude/android-signing-failure-q7zml9
Jul 9, 2026
Merged

Add GPG signing key preflight verification job to CI#138
bernardladenthin merged 2 commits into
mainfrom
claude/android-signing-failure-q7zml9

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

  • Added a new verify-signing-key job to the publish workflow that validates the GPG signing key and passphrase before the actual publish stage
  • The job imports the private key into an ephemeral keyring, verifies it is not expired, checks signing capability, and performs a sign/verify roundtrip to confirm the passphrase works
  • Catches configuration issues (missing/invalid key, expired key, wrong passphrase) in ~20 seconds instead of failing during the publish stage, improving CI feedback time
  • Implements strict security practices: never prints secret material, masks the passphrase, passes credentials only via file descriptors, and deliberately avoids set -x to prevent accidental secret leakage

Test plan

  • CI is green on this branch
  • The job runs in parallel at workflow start (no needs: dependency) and uses the maven-central environment to access the same GPG secrets as the publish jobs
  • Expected behavior: job goes RED on refs without secret access (fork PRs, contributor branches) — this is the intended signal that the ref cannot sign releases, not a regression
  • The job prints only PUBLIC key metadata (key ID, fingerprint, owner UID, algorithm, creation/expiry dates) and signature validation results

Related issues / PRs

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • My commits follow Conventional Commits
  • No security-sensitive changes (security practices documented in job comments)

https://claude.ai/code/session_018pwn51YPBbtiuUyiLRrfrG

claude added 2 commits July 9, 2026 08:08
Adds a standalone `verify-signing-key` job to publish.yml that reproduces
what maven-gpg-plugin does at deploy time, so a bad/expired key or wrong
passphrase is caught in ~20s instead of failing the publish stage.

- No `needs:` — runs in parallel at the very start of the pipeline.
- `environment: maven-central` — reads the SAME GPG_PRIVATE_KEY /
  GPG_PASSPHRASE secret the publish jobs use.
- Gated to workflow_dispatch + a new `verify_signing_key` checkbox, so it
  never runs on normal PR/push CI and only exercises the environment gate
  on demand.
- Prints only PUBLIC key metadata (key id, fingerprint, owner UID,
  algorithm, created/expiry); validates the passphrase via a throwaway
  sign+verify roundtrip. Passphrase is passed on fd 3 (never argv/logs),
  `set -x` is never enabled, and the passphrase is `::add-mask::`ed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018pwn51YPBbtiuUyiLRrfrG
Drop the workflow_dispatch checkbox and the if-gate so verify-signing-key
runs unconditionally in parallel at the start of every pipeline. A red on
refs where the secret is not delivered (fork PRs, other contributors'
branches) is the intended signal — "this ref cannot sign a release" — not
a regression.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018pwn51YPBbtiuUyiLRrfrG
@bernardladenthin
bernardladenthin merged commit 79be9bc into main Jul 9, 2026
9 of 12 checks passed
@bernardladenthin
bernardladenthin deleted the claude/android-signing-failure-q7zml9 branch July 9, 2026 09:18
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants