Repository navigation
FIX: Do not send a bogus Circle-Token header - #119
Merged
Merged
Conversation
With no api-token configured the action sent 'Circle-Token: null', which CircleCI now rejects with 401 Invalid token provided, even for public projects. Omitting the header entirely returns 200, so only send the header when a token was actually supplied. This repo's own test workflow passes secrets.CIRCLECI_TOKEN, so its self-test never exercised the tokenless path that public-repo users without an api-token rely on. Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Jul 28, 2026
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.
This is a live bug for every public-repo user who does not set
api-token, which is the documented default. Found while verifying the native-fetch swap in #118 against the real API.With no
api-token, the action sendsCircle-Token: null(the literal string). CircleCI rejects that:So the artifacts request 401s,
.itemsis missing, and the run fails. The fix is to send the header only when a token was actually supplied.Why CI never caught this
.github/workflows/status.ymlpassesapi-token: ${{ secrets.CIRCLECI_TOKEN }}, so this repo's own self-test always takes the authenticated path. The tokenless path that public-repo users depend on was never exercised — worth considering whether the self-test should cover both.Verification
Running
run()against the live CircleCI API (job 361, no token, onlygetOctokitfaked):and that URL returns
200. Before the fix the same script failed withCircleCI API returned 401. The unit test now asserts the header is absent rather than'null'; 22 tests, 100% coverage.Note this PR is branched off
master, not off #118, so it can go in independently — but it should be in the release.🤖 Generated with Claude Code