autobump: fix duplicate Authorization header, add job timeout - #2
Open
AsafMazuz1 wants to merge 1 commit into
Open
AsafMazuz1 wants to merge 1 commit into
AsafMazuz1 wants to merge 1 commit into
Conversation
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
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.
Why
brew bumpaccounted 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 amacos-26runner (10x minute multiplier), with all of the time in the Push commits step:git-try-pushretries 10 push attempts x 10 pull attempts with exponential backoff before giving up withMax 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(giventoken:) writes a globalhttp.https://github.com/.extraheaderAuthorization header, andHomebrew/actions/git-try-push(giventoken:) writes a local one on the same URL. git sends both and GitHub rejects the request.Fix
token:from thegit-try-pushstep.setup-homebrew's token is documented to persist for the whole job, so the push is still authenticated withGITHUB_TOKEN(contents: write).timeout-minutes: 30to the job so a hang can never run for hours again.Test plan
workflow_dispatchand confirm it completes in minutes, with the Push commits step succeeding (or being skipped if nothing is outdated)main🤖 Generated with Claude Code
https://claude.ai/code/session_01Q6jN7cTpidwNCFa3FsXEba