Skip to content

ci: keep the release token out of the push URL - #5

Merged
earakely-scale merged 1 commit into
mainfrom
ci/token-free-bump-push
Sep 30, 2026
Merged

earakely-scale merged 1 commit into
mainfrom
ci/token-free-bump-push

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

The release bump now passes its GitHub App token through a credential helper instead of embedding it in the remote URL, so the token can't appear in logs.

The URL keeps the x-access-token user name. Without it, CircleCI checkout's https://github.com → ssh rewrite would match the URL and send the push to the read-only deploy key.

This goes out as its own release, separate from the first release from this repository, so a problem here can be reverted on its own.

Test plan

  • After merge, with bump-version: the bump job pushes the version commit and tag, publish goes green on the tag, and the downstream pin bump runs.

🤖 Generated with Claude Code

RetriggerConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking need to limit where the helper supplies the release token.

Fix All in CursorFindings

  1. P2 Security Token can reach another host ▶
Fix with agent prompt
### Issue 1
scripts/circleci_release_bump.sh:27
The new `credential.helper` returns `GH_TOKEN` for any HTTPS Git host in this checkout. The bump job currently uses only GitHub, but if a later Git call uses another host, it could send that host the release token. Limit the helper to the intended host.

**How this was verified:** The helper returns `GH_TOKEN` without checking the host Git asks it to authenticate.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The release bump now gives Git its GitHub App token through a credential helper instead of putting it in the remote URL. It keeps the x-access-token username so CircleCI’s HTTPS-to-SSH rewrite does not match.

  • The HTTPS remote keeps the x-access-token username but leaves out the token.
  • A Git credential helper supplies GH_TOKEN as the password when Git asks.

Reviews (1) · Last reviewed commit: "ci: keep the release token out of the pu..."

The release bump passes its GitHub App token through a credential helper instead of
embedding it in the remote URL, so it can't appear in logs. The URL keeps the user name so
that CircleCI checkout's https-to-ssh rewrite doesn't match it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# The token reaches git through a credential helper that reads it from the environment at
# push time, so it is never part of a URL that git or this script could print. The user name
# stays in the URL so CircleCI checkout's global https-to-ssh insteadOf rewrite does not match.
git config credential.helper '!f() { echo username=x-access-token; echo "password=${GH_TOKEN}"; }; f'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 security Token can reach another host

The new credential.helper returns GH_TOKEN for any HTTPS Git host in this checkout. The bump job currently uses only GitHub, but if a later Git call uses another host, it could send that host the release token. Limit the helper to the intended host.

How this was verified: The helper returns GH_TOKEN without checking the host Git asks it to authenticate.

Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/circleci_release_bump.sh
Line: 27

Comment:
**Token can reach another host**

The new `credential.helper` returns `GH_TOKEN` for any HTTPS Git host in this checkout. The bump job currently uses only GitHub, but if a later Git call uses another host, it could send that host the release token. Limit the helper to the intended host.

**How this was verified:** The helper returns `GH_TOKEN` without checking the host Git asks it to authenticate.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Cursor Fix in Claude Code Fix in Codex

@earakely-scale
earakely-scale merged commit 06d1403 into main Sep 30, 2026
18 of 19 checks passed
@earakely-scale
earakely-scale deleted the ci/token-free-bump-push branch September 30, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant