Skip to content

ci(release): push via RELEASE_TOKEN PAT instead of deploy-key SSH#15

Merged
jcputney merged 1 commit into
mainfrom
ci/release-via-pat
May 20, 2026
Merged

ci(release): push via RELEASE_TOKEN PAT instead of deploy-key SSH#15
jcputney merged 1 commit into
mainfrom
ci/release-via-pat

Conversation

@jcputney
Copy link
Copy Markdown
Owner

Summary

The v0.4.0 release failed because maven-release-plugin's direct push to main was rejected by the new `main-protection` ruleset (8 required checks, strict). Deploy keys cannot be ruleset bypass actors. Switch to a fine-grained PAT (`RELEASE_TOKEN`) owned by the repo admin, whose Admin role IS in the ruleset's `bypass_actors`.

Changes

  • `actions/checkout` uses `token: ${{ secrets.RELEASE_TOKEN }}` — sets http.extraheader so subsequent git pushes authenticate as the PAT owner.
  • Drop the `webfactory/ssh-agent` step.
  • Override `developerConnection` to HTTPS in `release:prepare` (pom keeps SSH for local-dev convenience).
  • `github.repository` moved out of run: into env var per security guidance.

After this merges

Re-trigger `Release` workflow on main. Same expected pipeline as before:
preflight → 3-OS verify → release:prepare (now pushes via HTTPS+PAT, Admin bypasses ruleset) → release:perform (Maven Central) → SBOM collection → sigstore attestations → GitHub Release.

Follow-up (out of scope)

  • After 1–2 successful releases, delete the `MAVEN_RELEASE_SSH_KEY` repo secret and the corresponding deploy key (id 149818986). Currently unused.

The v0.4.0 release attempt failed because maven-release-plugin's direct
push to main was rejected by the new main-protection ruleset:

  remote: error: GH006: Protected branch update failed for refs/heads/main.
  remote: - 8 of 8 required status checks are expected.

Deploy keys can't be bypass actors on a ruleset (only Users, Apps, Teams,
or RepositoryRoles can). Switch to a fine-grained PAT owned by the repo
admin, whose Admin role IS a bypass actor on main-protection.

Changes:
- actions/checkout uses token: RELEASE_TOKEN, which configures an
  http.extraheader so all subsequent github.com pushes authenticate as
  the PAT owner.
- Drop the webfactory/ssh-agent step (no more SSH push).
- Override developerConnection to HTTPS in release:prepare so maven-
  release-plugin pushes over HTTPS and picks up that extraheader. (pom's
  developerConnection stays SSH for local-dev convenience.)
- Pull github.repository into a REPO env var per workflow security
  guidance (no longer interpolating ${{ }} directly in run: blocks).

MAVEN_RELEASE_SSH_KEY secret and the deploy key are now unused; can be
removed in a follow-up after one or two successful releases confirm the
PAT path.
@jcputney jcputney enabled auto-merge (squash) May 20, 2026 17:53
@jcputney jcputney merged commit 56e8cb1 into main May 20, 2026
11 checks passed
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.

1 participant