actions/checkout@v4 fails with "Duplicate header: Authorization" and throws "The requested URL returned error: 400"
I'm using actions/checkout@v4 with a Personal access tokens (classic) (TOKEN_GITHUB) that has full repository and workflow permissions, and SSO is enabled for the organization.
My workflow snippet:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN_GITHUB }}
fetch-depth: 0
On some runs, the checkout step fails with:
Run actions/checkout@v4
Syncing repository: <org>/<repo>
Getting Git version info
Copying '/.../.gitconfig' to '/.../_temp/.../.gitconfig'
Temporarily overriding HOME='/.../_temp/...'
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /.../aftersales365-consumer/aftersales365-consumer
Deleting the contents of '/.../aftersales365-consumer/aftersales365-consumer'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
/usr/bin/git -c protocol.version=2 fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*
remote: Duplicate header: "Authorization"
fatal: unable to access 'https://github.com/<org>/<repo>/': The requested URL returned error: 400
The process '/usr/bin/git' failed with exit code 128
This happens intermittently and sometimes resolves on re-run. Would appreciate guidance or a fix to avoid this intermittent failure.
did you figure anything out for this? recently started happening to us too
we also observe the same issue in github-enterprise
Intermittently occurring for us too
Happened to me just now, five times in a row ... and on the sixth try it worked again.
In my case the root issue was OOM. We had a process in workflow which caused OOM and kernel killed the whole runnner process, which impacted later on checkout action.
This same error started happening to me with actions/checkout@v6 - was caused by using v6 with peter-evans/[email protected]. The issue is fixed by updating to https://github.com/peter-evans/create-pull-request/releases/tag/v7.0.9.