Skip to content

remote: Duplicate header: "Authorization" error after upgrading to actions/checkout@v6 #988

Description

@danishnawab

After upgrading to actions/checkout@v6 the action fails with the following output:

Logs

Run gradle-update/update-gradle-wrapper-action@v2
/usr/bin/git config --local http.https://github.com/.extraheader Authorization: basic ***
Latest release: 9.2.1 (channel stable)
/usr/bin/git config --local user.name gradle-update-robot
/usr/bin/git config --local user.email gradle-update-robot@regolo.cc
/usr/bin/git fetch --depth=1
remote: Duplicate header: "Authorization"
fatal: unable to access 'https://github.com/corp/repo-name/': The requested URL returned error: 400
/usr/bin/git checkout main
Already on 'main'
Your branch is up to date with 'origin/main'.
/usr/bin/git rev-parse HEAD
$(commit hash)
Creating branch
Working with Wrapper at: /runner/_work/repo-name/repo-name/gradle/wrapper/gradle-wrapper.properties
Updating Wrapper
Checking whether any file has been updated
Updating Wrapper (2nd update)
Verifying Wrapper
Committing
Pushing branch
/usr/bin/git push --force-with-lease origin HEAD:refs/heads/gradlew-update-9.2.1
remote: Duplicate header: "Authorization"
fatal: unable to access 'https://github.com/corp/repo-name/': The requested URL returned error: 400
Creating Pull Request
Error: ❌ Validation Failed: {"resource":"PullRequest","field":"head","code":"invalid"} - https://docs.github.com/rest/pulls/pulls#create-a-pull-request

The workflow file:

Workflow file
name: Update Gradle Wrapper

on:
  schedule:
    - cron: "0 0 * * 0"
  workflow_dispatch:

jobs:
  update-gradle-wrapper:
    runs-on: self-hosted-runner

    steps:
      - uses: actions/checkout@v6

      - name: Update Gradle Wrapper
        uses: gradle-update/update-gradle-wrapper-action@v2
        with:
          merge-method: SQUASH
          set-distribution-checksum: false

The action runs on a self-hosted runner.

Please advise if this has to be fixed in update-gradle-wrapper-action or if this could somehow be caused by the setup of the self-hosted runner.


Here's the relevant issue on actions/checkout side: actions/checkout#2299

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions