Skip to content

ci: push release commits via deploy key instead of GITHUB_TOKEN - #463

Merged
legion-implementer[bot] merged 1 commit into
mainfrom
ci/release-push-via-deploy-key
Jul 13, 2026
Merged

ci: push release commits via deploy key instead of GITHUB_TOKEN#463
legion-implementer[bot] merged 1 commit into
mainfrom
ci/release-push-via-deploy-key

Conversation

@legion-implementer

Copy link
Copy Markdown
Contributor

Second (and final) release-pipeline bug, exposed by #462 getting further than any previous run:

semantic-release got all the way to pushing the chore(release): 0.1.0 commit, but the push was rejected by the main ruleset (GH013) even with Deploy keys on the bypass list. The failing command reveals why:

git push ***github.com/sjawhar/pivot.git main

PSR doesn't push via the checkout's SSH remote — it constructs its own HTTPS token URL from GH_TOKEN, so the pushing actor is the github-actions integration, which has no bypass. The DEPLOY_KEY never gets used for the push.

Fix: remote.ignore_token_for_push = true — PSR's documented option for exactly this ("ideal if you already have SSH keys set up for pushing"). The push then goes through origin (git@github.com:sjawhar/pivot.git + core.sshCommand with the deploy key, verified in the run 29273503528 logs), which is on the ruleset bypass list. GH_TOKEN is still used for creating the GitHub release.

After merge: Tests → Release → tag v0.1.0 → publish pivot + pivot-tui to PyPI via trusted publishing.

python-semantic-release ignores the checkout's SSH remote and pushes to an
HTTPS URL authenticated with GH_TOKEN, so the release commit push to main is
rejected by the branch ruleset (the github-actions integration has no bypass;
the deploy key does). Set remote.ignore_token_for_push so PSR pushes via
origin (SSH + DEPLOY_KEY), which is on the ruleset bypass list. GH_TOKEN is
still used to create the GitHub release.
@legion-implementer
legion-implementer Bot merged commit 6ca3f47 into main Jul 13, 2026
4 checks passed
@legion-implementer
legion-implementer Bot deleted the ci/release-push-via-deploy-key branch July 13, 2026 18:55
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