[ci] Fix BOT_TOKEN auth for Flex endpoint push and PR diff comment#1540
Merged
Conversation
The previous attempt still failed: - The Flex push embedded the token in the URL, but actions/checkout had persisted an http.<host>.extraheader Authorization for the default GITHUB_TOKEN, which git sends in preference to the URL credentials — so the push authenticated as github-actions[bot] and got 403. Unset that header before pushing so the BOT_TOKEN in the URL is used. - marocchino/sticky-pull-request-comment reads the token from its GITHUB_TOKEN input (default github.token), not the env var, so the read-only default token was still used. Pass it via "with:" instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Follow-up to #1539, which did not fully fix the QA failures. Two issues remained:
Flex endpoint push — embedding
BOT_TOKENin the push URL was not enough.actions/checkoutpersists anhttp.https://github.com/.extraheaderAuthorization header (carrying the default, now read-onlyGITHUB_TOKEN) into.git/config, and git sends that header in preference to URL-embedded credentials. The push therefore authenticated asgithub-actions[bot]:Fixed by unsetting that header before pushing, so the
BOT_TOKENin the URL is used.PR diff comment —
marocchino/sticky-pull-request-commentreads its token from theGITHUB_TOKENinput (default${{ github.token }}), not from theGITHUB_TOKENenv var. The env var added in #1539 was ignored and the read-only default token was still used (Resource not accessible by integration). Fixed by passing the token viawith:instead.🤖 Generated with Claude Code