ci: fix bump-platform-submodule auth (Basic, not Bearer)#395
Conversation
The persist-credentials: false hardening from #394 broke the first post-merge run with: fatal: could not read Username for 'https://github.com' The inline http.extraheader was using "Authorization: bearer <pat>", which authenticates GitHub's REST API but not git-over-HTTPS smart protocol — git push/fetch want Basic auth with `x-access-token:<pat>` (what actions/checkout itself sets internally when persist-credentials is true). Swap to the base64-encoded Basic header so both the push and the fetch in the rebase-and-retry loop authenticate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe workflow's git authentication for cross-repo push/fetch operations is changed from Bearer to base64-encoded Basic auth headers. The ChangesGit Authentication Fix for Submodule Bump
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
Actionable comments posted: 0 |
Summary
Fixes the first post-merge run of
.github/workflows/bump-platform-submodule.yml(introduced in #394), which failed with:Run: https://github.com/FailproofAI/failproofai/actions/runs/26587331160/job/78336760505
Root cause
The CodeRabbit hardening in #394 set
persist-credentials: falseon theactions/checkoutstep (correct — keeps the cross-repo PAT out of.git/config) and then authenticatedgit push/git fetchinline via:That works for GitHub's REST API but not for git-over-HTTPS smart-protocol. GitHub's git endpoints expect Basic auth with
x-access-token:<pat>as the credential pair — the exact formatactions/checkoutwrites internally whenpersist-credentials: true. With Bearer, git gets a 401, falls through to interactive credential prompting, and dies on stdin (fatal: could not read Username).Fix
Swap the header to base64-encoded Basic auth, matching
actions/checkout's own extraheader format:persist-credentials: falseand the SHA pin from #394 stay in place — the token is still never written to.git/config, and both the push and the rebase-and-retry fetch in the loop now authenticate correctly.Test plan
push: main/workflow_dispatch).Bump platform submodule pointerrun onmainlands a freshBump failproofai/oss to <short-sha>commit onFailproofAI/platformmain(verify withgit log --oneline main -3in that repo).Summary by CodeRabbit
Bug Fixes
Documentation