-
-
Notifications
You must be signed in to change notification settings - Fork 517
Fix compatibility with actions/checkout@v6 #4230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compatibility with actions/checkout@v6 #4230
Conversation
Temporarily hides checkout@v6 credential files to prevent duplicate Authorization headers. Fixes peter-evans#4228
1edb703 to
7f9b670
Compare
| yield this.gitConfigStringReplace(this.extraheaderConfigPlaceholderValue, extraheaderConfigValue); | ||
| }); | ||
| } | ||
| hideCredentialFiles() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested E2E here:
Workflow YAML
jobs:
test-checkout-v6:
runs-on: ubuntu-latest
steps:
- name: Checkout with v6
uses: actions/checkout@v6
- name: Make a test change
run: |
echo "Test change at $(date)" >> test-file.txt
echo "This tests checkout@v6 compatibility"
- name: Create Pull Request
uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'test: checkout@v6 compatibility test'
title: 'Test: checkout@v6 compatibility'
body: |
Automated test of checkout@v6 compatibility fix
This PR tests that create-pull-request works correctly with actions/checkout@v6
branch: test/checkout-v6-compat
delete-branch: true
test-checkout-v5:
runs-on: ubuntu-latest
steps:
- name: Checkout with v5
uses: actions/checkout@v5
- name: Make a test change
run: |
echo "Test change at $(date)" >> test-file-v5.txt
echo "This tests backward compatibility with checkout@v5"
- name: Create Pull Request
uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'test: checkout@v5 backward compatibility test'
title: 'Test: checkout@v5 compatibility'
body: |
Automated test of checkout@v5 backward compatibility
This PR verifies that the fix doesn't break checkout@v5 workflows
branch: test/checkout-v5-compat
delete-branch: true|
/test repository=ericsciple/create-pull-request ref=users/ericsciple/25-11-creds build=true |
|
/test repository=ericsciple/create-pull-request ref=users/ericsciple/25-11-creds |
|
@ericsciple Thank you for raising this fix! Very much appreciated. ❤️ I'll take a look at what changed in v6 at some point to see if there is anything I should do differently. |
I guess the getAndUnset() used to hide the extraheader credentials: But credentials have been refactored in |
Bumps the github-actions group with 4 updates: [anchore/scan-action](https://github.com/anchore/scan-action), [github/codeql-action](https://github.com/github/codeql-action), [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) and [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `anchore/scan-action` from 7.1.0 to 7.2.0 Release notes *Sourced from [anchore/scan-action's releases](https://github.com/anchore/scan-action/releases).* > v7.2.0 > ------ > > New in scan-action v7.2.0 > ------------------------- > > * chore(deps): update Grype to v0.104.0 ([#541](https://redirect.github.com/anchore/scan-action/issues/541)) [[[anchore-actions-token-generator[bot]](https://github.com/apps/anchore-actions-token-generator)]([https://github.com/[anchore-actions-token-generator[bot]](https://github.com/apps/anchore-actions-token-generator))]](https://github.com/%5Banchore-actions-token-generator%5Bbot%5D%5D(https://github.com/apps/anchore-actions-token-generator))%5D) > * chore(deps-dev): bump tar from 7.5.1 to 7.5.2 ([#538](https://redirect.github.com/anchore/scan-action/issues/538)) [[[dependabot[bot]](https://github.com/apps/dependabot)]([https://github.com/[dependabot[bot]](https://github.com/apps/dependabot))]](https://github.com/%5Bdependabot%5Bbot%5D%5D(https://github.com/apps/dependabot))%5D) > * chore(deps-dev): bump eslint from 9.38.0 to 9.39.0 ([#539](https://redirect.github.com/anchore/scan-action/issues/539)) [[[dependabot[bot]](https://github.com/apps/dependabot)]([https://github.com/[dependabot[bot]](https://github.com/apps/dependabot))]](https://github.com/%5Bdependabot%5Bbot%5D%5D(https://github.com/apps/dependabot))%5D) Commits * [`3aaf50d`](anchore/scan-action@3aaf50d) chore(deps): update Grype to v0.104.0 ([#541](https://redirect.github.com/anchore/scan-action/issues/541)) * [`2aa9b8d`](anchore/scan-action@2aa9b8d) chore(deps-dev): bump tar from 7.5.1 to 7.5.2 ([#538](https://redirect.github.com/anchore/scan-action/issues/538)) * [`a60ac37`](anchore/scan-action@a60ac37) chore(deps-dev): bump eslint from 9.38.0 to 9.39.0 ([#539](https://redirect.github.com/anchore/scan-action/issues/539)) * See full diff in [compare view](anchore/scan-action@568b89d...3aaf50d) Updates `github/codeql-action` from 4.31.3 to 4.31.5 Release notes *Sourced from [github/codeql-action's releases](https://github.com/github/codeql-action/releases).* > v4.31.5 > ------- > > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > 4.31.5 - 24 Nov 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.6. [#3321](https://redirect.github.com/github/codeql-action/pull/3321) > > See the full [CHANGELOG.md](https://github.com/github/codeql-action/blob/v4.31.5/CHANGELOG.md) for more information. > > v4.31.4 > ------- > > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > 4.31.4 - 18 Nov 2025 > -------------------- > > No user facing changes. > > See the full [CHANGELOG.md](https://github.com/github/codeql-action/blob/v4.31.4/CHANGELOG.md) for more information. Changelog *Sourced from [github/codeql-action's changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md).* > CodeQL Action Changelog > ======================= > > See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. > > [UNRELEASED] > ------------ > > No user facing changes. > > 4.31.5 - 24 Nov 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.6. [#3321](https://redirect.github.com/github/codeql-action/pull/3321) > > 4.31.4 - 18 Nov 2025 > -------------------- > > No user facing changes. > > 4.31.3 - 13 Nov 2025 > -------------------- > > * CodeQL Action v3 will be deprecated in December 2026. The Action now logs a warning for customers who are running v3 but could be running v4. For more information, see [Upcoming deprecation of CodeQL Action v3](https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/). > * Update default CodeQL bundle version to 2.23.5. [#3288](https://redirect.github.com/github/codeql-action/pull/3288) > > 4.31.2 - 30 Oct 2025 > -------------------- > > No user facing changes. > > 4.31.1 - 30 Oct 2025 > -------------------- > > * The `add-snippets` input has been removed from the `analyze` action. This input has been deprecated since CodeQL Action 3.26.4 in August 2024 when this removal was announced. > > 4.31.0 - 24 Oct 2025 > -------------------- > > * Bump minimum CodeQL bundle version to 2.17.6. [#3223](https://redirect.github.com/github/codeql-action/pull/3223) > * When SARIF files are uploaded by the `analyze` or `upload-sarif` actions, the CodeQL Action automatically performs post-processing steps to prepare the data for the upload. Previously, these post-processing steps were only performed before an upload took place. We are now changing this so that the post-processing steps will always be performed, even when the SARIF files are not uploaded. This does not change anything for the `upload-sarif` action. For `analyze`, this may affect Advanced Setup for CodeQL users who specify a value other than `always` for the `upload` input. [#3222](https://redirect.github.com/github/codeql-action/pull/3222) > > 4.30.9 - 17 Oct 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.3. [#3205](https://redirect.github.com/github/codeql-action/pull/3205) > * Experimental: A new `setup-codeql` action has been added which is similar to `init`, except it only installs the CodeQL CLI and does not initialize a database. Do not use this in production as it is part of an internal experiment and subject to change at any time. [#3204](https://redirect.github.com/github/codeql-action/pull/3204) > > 4.30.8 - 10 Oct 2025 > -------------------- > > No user facing changes. > > 4.30.7 - 06 Oct 2025 > -------------------- > > * [v4+ only] The CodeQL Action now runs on Node.js v24. [#3169](https://redirect.github.com/github/codeql-action/pull/3169) > > 3.30.6 - 02 Oct 2025 > -------------------- > > * Update default CodeQL bundle version to 2.23.2. [#3168](https://redirect.github.com/github/codeql-action/pull/3168) ... (truncated) Commits * [`fdbfb4d`](github/codeql-action@fdbfb4d) Merge pull request [#3322](https://redirect.github.com/github/codeql-action/issues/3322) from github/update-v4.31.5-ec2ee575c * [`81f6d64`](github/codeql-action@81f6d64) Update changelog for v4.31.5 * [`ec2ee57`](github/codeql-action@ec2ee57) Merge pull request [#3321](https://redirect.github.com/github/codeql-action/issues/3321) from github/update-bundle/codeql-bundle-v2.23.6 * [`ecc8787`](github/codeql-action@ecc8787) Add changelog note * [`1d2a238`](github/codeql-action@1d2a238) Update default bundle to codeql-bundle-v2.23.6 * [`ce729e4`](github/codeql-action@ce729e4) Merge pull request [#3315](https://redirect.github.com/github/codeql-action/issues/3315) from github/henrymercer/dead-code-elimination * [`ac359aa`](github/codeql-action@ac359aa) Add return type * [`112cd07`](github/codeql-action@112cd07) Merge branch 'main' into henrymercer/dead-code-elimination * [`0b43179`](github/codeql-action@0b43179) Merge pull request [#3306](https://redirect.github.com/github/codeql-action/issues/3306) from github/dependabot/npm\_and\_yarn/types/sinon-21.0.0 * [`e818008`](github/codeql-action@e818008) Merge pull request [#3305](https://redirect.github.com/github/codeql-action/issues/3305) from github/dependabot/npm\_and\_yarn/eslint/compat-2.0.0 * Additional commits viewable in [compare view](github/codeql-action@014f16e...fdbfb4d) Updates `peter-evans/create-pull-request` from 7.0.8 to 7.0.9 Release notes *Sourced from [peter-evans/create-pull-request's releases](https://github.com/peter-evans/create-pull-request/releases).* > Create Pull Request v7.0.9 > -------------------------- > > ⚙️ Fixes an [incompatibility](https://redirect.github.com/peter-evans/create-pull-request/issues/4228) with the recently released `actions/checkout@v6`. > > What's Changed > -------------- > > * ~70 dependency updates by [`@dependabot`](https://github.com/dependabot) > * docs: fix workaround description about `ready_for_review` by [`@ybiquitous`](https://github.com/ybiquitous) in [peter-evans/create-pull-request#3939](https://redirect.github.com/peter-evans/create-pull-request/pull/3939) > * Docs: `add-paths` default behavior by [`@joeflack4`](https://github.com/joeflack4) in [peter-evans/create-pull-request#3928](https://redirect.github.com/peter-evans/create-pull-request/pull/3928) > * docs: update to create-github-app-token v2 by [`@Goooler`](https://github.com/Goooler) in [peter-evans/create-pull-request#4063](https://redirect.github.com/peter-evans/create-pull-request/pull/4063) > * Fix compatibility with actions/checkout@v6 by [`@ericsciple`](https://github.com/ericsciple) in [peter-evans/create-pull-request#4230](https://redirect.github.com/peter-evans/create-pull-request/pull/4230) > > New Contributors > ---------------- > > * [`@joeflack4`](https://github.com/joeflack4) made their first contribution in [peter-evans/create-pull-request#3928](https://redirect.github.com/peter-evans/create-pull-request/pull/3928) > * [`@Goooler`](https://github.com/Goooler) made their first contribution in [peter-evans/create-pull-request#4063](https://redirect.github.com/peter-evans/create-pull-request/pull/4063) > * [`@ericsciple`](https://github.com/ericsciple) made their first contribution in [peter-evans/create-pull-request#4230](https://redirect.github.com/peter-evans/create-pull-request/pull/4230) > > **Full Changelog**: <peter-evans/create-pull-request@v7.0.8...v7.0.9> Commits * [`84ae59a`](peter-evans/create-pull-request@84ae59a) fix: compatibility with actions/checkout@v6 ([#4230](https://redirect.github.com/peter-evans/create-pull-request/issues/4230)) * [`b4733b9`](peter-evans/create-pull-request@b4733b9) build(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 ([#4222](https://redirect.github.com/peter-evans/create-pull-request/issues/4222)) * [`0edc001`](peter-evans/create-pull-request@0edc001) build(deps-dev): bump the npm group with 2 updates ([#4201](https://redirect.github.com/peter-evans/create-pull-request/issues/4201)) * [`430aea0`](peter-evans/create-pull-request@430aea0) build(deps): bump the github-actions group with 3 updates ([#4200](https://redirect.github.com/peter-evans/create-pull-request/issues/4200)) * [`46cdba7`](peter-evans/create-pull-request@46cdba7) build(deps-dev): bump the npm group with 3 updates ([#4185](https://redirect.github.com/peter-evans/create-pull-request/issues/4185)) * [`b937339`](peter-evans/create-pull-request@b937339) build(deps): bump the github-actions group with 2 updates ([#4184](https://redirect.github.com/peter-evans/create-pull-request/issues/4184)) * [`e9af275`](peter-evans/create-pull-request@e9af275) ci: update dependabot config * [`d3e081a`](peter-evans/create-pull-request@d3e081a) build(deps-dev): bump `@types/node` from 18.19.127 to 18.19.128 ([#4178](https://redirect.github.com/peter-evans/create-pull-request/issues/4178)) * [`9ec683e`](peter-evans/create-pull-request@9ec683e) build(deps-dev): bump `@types/node` from 18.19.125 to 18.19.127 ([#4165](https://redirect.github.com/peter-evans/create-pull-request/issues/4165)) * [`65d8d10`](peter-evans/create-pull-request@65d8d10) build(deps-dev): bump ts-jest from 29.4.2 to 29.4.4 ([#4163](https://redirect.github.com/peter-evans/create-pull-request/issues/4163)) * Additional commits viewable in [compare view](peter-evans/create-pull-request@271a8d0...84ae59a) Updates `ruby/setup-ruby` from 1.267.0 to 1.268.0 Release notes *Sourced from [ruby/setup-ruby's releases](https://github.com/ruby/setup-ruby/releases).* > v1.268.0 > -------- > > What's Changed > -------------- > > * Add ruby-4.0.0-preview2 by [`@ruby-builder-bot`](https://github.com/ruby-builder-bot) in [ruby/setup-ruby#825](https://redirect.github.com/ruby/setup-ruby/pull/825) > > **Full Changelog**: <ruby/setup-ruby@v1.267.0...v1.268.0> Commits * [`8aeb6ff`](ruby/setup-ruby@8aeb6ff) Test Ruby 4.0 previews * [`09e84e3`](ruby/setup-ruby@09e84e3) Add ruby-4.0.0-preview2 * See full diff in [compare view](ruby/setup-ruby@d5126b9...8aeb6ff) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Temporarily hides checkout@v6 credential files to prevent duplicate Authorization headers. Fixes peter-evans#4228
Temporarily hides checkout@v6 credential files to prevent duplicate Authorization headers.
Fixes issue:
Solution approach:
This avoids the duplicate header error while properly preserving and restoring checkout's credentials for use in subsequent workflow steps.