Skip to content

fix: pass GITHUB_TOKEN to the Check links CI step - #1001

Open
Pranav-IIITM wants to merge 1 commit into
buildpacks:mainfrom
Pranav-IIITM:fix/check-links-github-token
Open

Pranav-IIITM wants to merge 1 commit into
buildpacks:mainfrom
Pranav-IIITM:fix/check-links-github-token

Conversation

@Pranav-IIITM

Copy link
Copy Markdown
Contributor

Closes #1000

What changed

  • The Check links step in CI now gets the same GitHub token that the Test and Build steps already use.
  • If the latest pack version can't be looked up, the build now says so clearly and suggests how to fix it, instead of failing with a confusing jq parse error.

Why

Check links was looking up the latest pack version without a token. On GitHub's shared runners that request can hit the anonymous rate limit, which made the build job fail at random on PRs that had nothing wrong with them. Contributors can't re-run the job themselves, so they had to push empty commits just to get a fresh run.

With this change, CI should stop failing for reasons unrelated to the PR, and if the lookup does fail, the error says what went wrong.

The Check links step looked up the latest pack version from the GitHub API
without a token, so it was rate limited on shared runners and failed at
random. Pass the token like the Test and Build steps do, and print a clear
message when the version lookup fails.

Signed-off-by: Pranav-IIITM <jogdandpranav2007@gmail.com>
@Pranav-IIITM
Pranav-IIITM requested a review from a team as a code owner November 8, 2026 12:17
@Pranav-IIITM

Copy link
Copy Markdown
Contributor Author

Evidence of the flaky failure, from CI runs on #999, which doesn't touch CI or the Makefile:

Run Commit Version lookup in Check links Result
Run 1 ee28c4c4 ❌ jq: parse error: Invalid numeric literal → make: *** [Makefile:111: pack-version] Error 1 failed
Run 2 8a876dd7 (empty commit, same code as run 1) ✅ PACK_VERSION=0.40.10 lookup worked; the job later failed on an unrelated broken link that was fixed in #999
Run 3 365d4ef2 ✅ PACK_VERSION=0.40.10 passed

Runs 1 and 2 used identical code and the same workflow, yet the version lookup failed in one and worked in the other. That fits the anonymous GitHub API rate limit on shared runners: Check links makes the request without GITHUB_TOKEN, so whether it works depends on how much of the runner IP's anonymous allowance is left.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: "Check links" step fails intermittently because the GitHub API call isn't logged in

1 participant