Skip to content

autobump: fix duplicate Authorization header, add job timeout - #2

Open
AsafMazuz1 wants to merge 1 commit into
mainfrom
fix/autobump-duplicate-auth-header
Open

AsafMazuz1 wants to merge 1 commit into
mainfrom
fix/autobump-duplicate-auth-header

Conversation

@AsafMazuz1

Copy link
Copy Markdown
Contributor

Why

brew bump accounted for ~93% of the org's GitHub Actions spend this billing cycle ($165 of $177 gross). Every scheduled run since #11 failed after ~3h 9m on a macos-26 runner (10x minute multiplier), with all of the time in the Push commits step:

remote: Duplicate header: "Authorization"
fatal: unable to access 'https://github.com/AppitStudio/homebrew-apps/': The requested URL returned error: 400

git-try-push retries 10 push attempts x 10 pull attempts with exponential backoff before giving up with Max tries reached, which is where the 3 hours go. Runs #8-10 were fast only because every cask was up to date and the push step was skipped.

Cause

Homebrew/actions/setup-homebrew (given token:) writes a global http.https://github.com/.extraheader Authorization header, and Homebrew/actions/git-try-push (given token:) writes a local one on the same URL. git sends both and GitHub rejects the request.

Fix

  • Drop token: from the git-try-push step. setup-homebrew's token is documented to persist for the whole job, so the push is still authenticated with GITHUB_TOKEN (contents: write).
    • Add timeout-minutes: 30 to the job so a hang can never run for hours again.

Test plan

  • Merge, re-enable the workflow (it was disabled manually to stop tonight's run)
  • - [ ] Trigger via workflow_dispatch and confirm it completes in minutes, with the Push commits step succeeding (or being skipped if nothing is outdated)
  • - [ ] Check the bumped cask commit lands on main
    🤖 Generated with Claude Code

https://claude.ai/code/session_01Q6jN7cTpidwNCFa3FsXEba

Every scheduled run since #11 failed after ~3h9m on a macOS runner: the Push commits step got 'remote: Duplicate header: "Authorization"' / HTTP 400 on every push and pull, and git-try-push's nested retry loop (10 push tries x 10 pull tries, exponential backoff) burned the time. That was ~93% of the org's Actions spend this cycle.

Cause: setup-homebrew (given token:) sets a global http.https://github.com/.extraheader, and git-try-push (given token:) sets a local one too, so git sends two Authorization headers.

Fix: drop token: from git-try-push (setup-homebrew's token is documented to persist for the job), and add timeout-minutes: 30 so a hang can never run for hours again.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q6jN7cTpidwNCFa3FsXEba
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.

1 participant