ci(release): push the release commit over SSH with a deploy key - #326
Merged
Conversation
The release push went out as RTLDEV_MW_CI_TOKEN, a personal account's PAT with
admin over every repository in the organisation. It worked against classic
branch protection only because enforce_admins is false and the token's owner is
an admin — an implicit bypass that rulesets do not have, which is why this
repository has had RULESET_ENABLED=false and weaker protection than before the
settings were centralised.
The push now uses a deploy key scoped to this repository (RTLDEV_MW_CI_SSH_KEY),
which the default-branch-protection ruleset names as its only bypass actor. A
leaked key costs one repository instead of all of them, and the personal account
stops being the push identity.
repositoryUrl is not optional. lib/get-git-auth-url.js expands shortcut URLs to
HTTPS before SSH is attempted, and package.json's "repository" is a shortcut
("github:centralnicgroup-opensource/rtldev-middleware-php-sdk.git"), so without
the explicit git@github.com form SSH is never tried at all.
GITHUB_TOKEN stays: @semantic-release/github creates the GitHub release with it
and publish-docs.sh force-pushes gh-pages with it. Only the git push moved. The
gh-pages push needs no change — the ruleset targets ~DEFAULT_BRANCH.
Requires centralnicgroup-opensource/rtldev-middleware-shareable-workflows to
provide the SSH key first; that change lands before this one.
KaiSchwarz-cnic
force-pushed
the
RSRMID-2994/release-push-deploy-key
branch
from
August 26, 2026 13:32
e91a894 to
cf7be3a
Compare
Collaborator
Author
|
🎉 This PR is included in version 33.0.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of RSRMID-2994 — this repository is the pilot.
What
.releaserc.json: pinsrepositoryUrltogit@github.com:centralnicgroup-opensource/rtldev-middleware-php-sdk.git.docs/agents/ci-release.md: documents the new release-push auth and the two traps in it.Why
repositoryUrlis not optionalsemantic-release's
lib/get-git-auth-url.jsexpands shortcut URLs to HTTPS before it ever tries SSH:package.jsoncarries"repository": "github:centralnicgroup-opensource/rtldev-middleware-php-sdk.git"— a shortcut. Without this override SSH is never attempted at all, and the deploy key on the runner goes unused.What this buys
The
@semantic-release/gitpush moves offRTLDEV_MW_CI_TOKEN— a personal account's PAT with admin over every repository in the organisation — and onto a deploy key scoped to this repository alone. That is what makes thedefault-branch-protectionruleset switchable on here:DeployKeyis its only bypass actor, so the release push gets past it and nothing else does. Until now this repository carriedreleases-to-branchin the workspace register, meaning branch protection was withheld entirely for want of a bypass.Unchanged on purpose
GITHUB_TOKENstays in the release step:@semantic-release/githubcreates the GitHub release with it, and.github/scripts/publish-docs.shforce-pushesgh-pageswith it.gh-pagespush is not moved to the deploy key. The ruleset targets~DEFAULT_BRANCH, so that push is not subject to it, and moving it would widen what the key is used for without removing a restriction.Order
Merge after centralnicgroup-opensource/rtldev-middleware-shareable-workflows#104, which puts the key on the runner. Merging this first would point the push at SSH with no key present, and the release would fall back to HTTPS.
Then the workspace register PR, then
scripts/org-settings.sh --apply php-sdkto create the ruleset, then a real release verified withDEBUG: semantic-release:get-git-auth-url.🤖 Generated with Claude Code