ci(release): rewrite SSH URL to HTTPS so release:prepare push uses PAT#16
Merged
Conversation
The previous PAT swap unblocked checkout's HTTPS clone but not maven- release-plugin's push. `release:prepare` reads pom's <developerConnection> directly and does NOT expose a `developerConnection` CLI override (only `connectionUrl`, which `release:perform` consumes for the post-tag checkout). So `-DdeveloperConnection=...` had no effect — the push still ran against pom's SSH URL and failed with "Permission denied (publickey)" because there's no SSH key on the runner anymore. Fix: git URL rewriting via `url.<base>.insteadOf`. When maven-scm- provider-gitexe spawns `git push git@github.com:jcputney/magika-java.git`, git transparently rewrites the URL to `https://github.com/...`, and the http.extraheader set up by actions/checkout authenticates the push with the RELEASE_TOKEN PAT. This leaves pom.xml's developerConnection at its SSH URL — local devs running `mvn release:prepare` continue to work the same way.
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.
Summary
Second swing at unblocking the v0.4.0 release. Previous PAT swap fixed checkout but `release:prepare` still failed:
```
git@github.com: Permission denied (publickey).
```
Root cause: `release:prepare` reads pom's `` directly and does NOT honor `-DdeveloperConnection=...` as a CLI override (only `-DconnectionUrl=...` is exposed, and only for `release:perform`). So pom's SSH URL was still in play, but the runner has no SSH key.
Fix
Add `git config --global url."https://github.com/".insteadOf "git@github.com:"` before `mvn release:prepare`. When maven-scm-provider-gitexe spawns `git push git@github.com:...`, git transparently rewrites to HTTPS, and the http.extraheader from `actions/checkout` (set up by the RELEASE_TOKEN PAT) authenticates the push. PAT owner has Admin role, which is in main-protection ruleset's bypass_actors → push succeeds.
pom.xml unchanged — local devs keep their SSH workflow.
Test plan