Files
devvm/scripts
w3cjandClaude Opus 5.5 0c6ee50ff5 fix(bump): GitHub's API calls send the workflow's token
The Pins workflow's run on 30 November failed right after nix with
"curl: (22) The requested URL returned error: 403". The next call was
direnv's gh_latest, an unauthenticated curl to api.github.com: GitHub
allows 60 of those an hour from one address, which a hosted runner
shares with other jobs, and answers 403 once they're spent. The workflow
already set GH_TOKEN and GITHUB_TOKEN for gh, but curl never sent them.

gh_api now makes every GitHub API call (gh_latest, gh_head and Lima's
release), with GH_TOKEN or else GITHUB_TOKEN when one is set, written
to a header file in the run's temp folder (mode 600) and passed as
-H @FILE, so it's on no command line and goes to api.github.com alone.
A failed fetch now names its URL, which the failed run's log didn't.

bump.txtar's curl stub records the header files it reads, and the test
checks that GitHub's API gets GITHUB_TOKEN, and GH_TOKEN when both are
set, that for each no other URL and no argument gets it, that no call
has a header without one, and that a failed fetch names its URL. It
fails on the old script. Contributing's Updating pinned versions and
the Pins workflow's comment say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 23:15:59 -07:00
..