-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Persist creds to a separate file #2286
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
Conversation
a370417 to
eddff11
Compare
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.
Pull Request Overview
This PR refactors Git credential management to persist credentials in a separate config file instead of directly in the repository's .git/config. The change improves security by isolating credentials from the main Git configuration and uses Git's includeIf mechanism to conditionally include the credentials when needed.
Key changes:
- Moves credential storage from
.git/configto a separate file inRUNNER_TEMP - Uses Git's
includeIf.gitdirfeature to conditionally include credentials based on Git directory path - Updates both main repository and submodule authentication to use the new approach
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/git-command-manager.ts | Adds new methods for config file operations and configFile parameter support |
| src/git-auth-helper.ts | Refactors credential management to use separate config files with includeIf entries |
| test/verify-submodules-true.sh | Updates test to use --includes flag when checking for credentials |
| test/verify-submodules-recursive.sh | Updates test to use --includes flag when checking for credentials |
| test/git-directory-helper.test.ts | Adds mock implementations for new git command manager methods |
| test/git-auth-helper.test.ts | Updates tests to verify new credential file structure and behavior |
| .github/workflows/test.yml | Adjusts workflow paths to avoid conflicts with new checkout behavior |
Comments suppressed due to low confidence (1)
src/git-auth-helper.ts:1
- The test name
configureAuth_AcceptsGitHubServerUrlSetToGHECdoesn't match the test description 'inject https://github.com as github server url'. Consider using a more descriptive name likeconfigureAuth_AcceptsGitHubServerUrlto match the actual test purpose.
import * as assert from 'assert'
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
eddff11 to
cb17bfb
Compare
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | major | `v5.0.1` -> `v6.0.0` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v6.0.0`](https://github.com/actions/checkout/releases/tag/v6.0.0) [Compare Source](actions/checkout@v5.0.1...v6.0.0) #### What's Changed - Update README to include Node.js 24 support details and requirements by [@​salmanmkc](https://github.com/salmanmkc) in [#​2248](actions/checkout#2248) - Persist creds to a separate file by [@​ericsciple](https://github.com/ericsciple) in [#​2286](actions/checkout#2286) - v6-beta by [@​ericsciple](https://github.com/ericsciple) in [#​2298](actions/checkout#2298) - update readme/changelog for v6 by [@​ericsciple](https://github.com/ericsciple) in [#​2311](actions/checkout#2311) **Full Changelog**: <actions/checkout@v5.0.0...v6.0.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOC4wIiwidXBkYXRlZEluVmVyIjoiNDIuMTguMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9kZXBlbmRlbmNpZXMiXX0=--> Reviewed-on: https://git.tainton.uk/repos/roboluke/pulls/396 Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk> Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | major | `v5.0.1` -> `v6.0.0` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v6.0.0`](https://github.com/actions/checkout/releases/tag/v6.0.0) [Compare Source](actions/checkout@v5.0.1...v6.0.0) #### What's Changed - Update README to include Node.js 24 support details and requirements by [@​salmanmkc](https://github.com/salmanmkc) in [#​2248](actions/checkout#2248) - Persist creds to a separate file by [@​ericsciple](https://github.com/ericsciple) in [#​2286](actions/checkout#2286) - v6-beta by [@​ericsciple](https://github.com/ericsciple) in [#​2298](actions/checkout#2298) - update readme/changelog for v6 by [@​ericsciple](https://github.com/ericsciple) in [#​2311](actions/checkout#2311) **Full Changelog**: <actions/checkout@v5.0.0...v6.0.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOC4wIiwidXBkYXRlZEluVmVyIjoiNDIuMTguMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9kZXBlbmRlbmNpZXMiXX0=--> Reviewed-on: https://git.tainton.uk/repos/epage/pulls/179 Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk> Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
actions/checkout@v6 moved credentials from .git/config to a separate file using includeIf for security (actions/checkout#2286). This breaks quarto publish gh-pages which uses git worktrees, since the includeIf condition doesn't match worktree paths. The fix propagates the credential configuration to worktrees by adding a second includeIf rule that matches .git/worktrees/* paths. This is backward compatible - it only runs if v6-style credentials exist. Also updates test.yaml to use checkout@v6 and documents v6 compatibility in publish/README.md.
## Version 11.7.6 ### 🛠 Fixes & Updates * **deps:** bump actions/checkout from 5 to 6 ([#1241](#1241)) ([2c36df2](2c36df2)), closes [actions/checkout#2248](actions/checkout#2248) [actions/checkout#2286](actions/checkout#2286) [actions/checkout#2298](actions/checkout#2298) [actions/checkout#2311](actions/checkout#2311) [actions/checkout#2301](actions/checkout#2301) [actions/checkout#2286](actions/checkout#2286) [actions/checkout#2248](actions/checkout#2248) [actions/checkout#2301](actions/checkout#2301) [actions/checkout#2226](actions/checkout#2226) [actions/checkout#2305](actions/checkout#2305) [actions/checkout#1971](actions/checkout#1971) [actions/checkout#1977](actions/checkout#1977) [actions/checkout#2043](actions/checkout#2043) [actions/checkout#2044](actions/checkout#2044) [actions/checkout#2194](actions/checkout#2194) [actions/checkout#2224](actions/checkout#2224) [actions/checkout#2236](actions/checkout#2236) [actions/checkout#1941](actions/checkout#1941) [actions/checkout#1946](actions/checkout#1946) [actions/checkout#1924](actions/checkout#1924) [actions/checkout#1180](actions/checkout#1180) [actions/checkout#1777](actions/checkout#1777) [actions/checkout#1872](actions/checkout#1872) [actions/checkout#1739](actions/checkout#1739) [actions/checkout#1697](actions/checkout#1697) [actions/checkout#1774](actions/checkout#1774) [actions/checkout#1776](actions/checkout#1776) [actions/checkout#1732](actions/checkout#1732) [actions/checkout#1703](actions/checkout#1703) [actions/checkout#1694](actions/checkout#1694) [actions/checkout#1696](actions/checkout#1696) [actions/checkout#1695](actions/checkout#1695) [#2311](https://github.com/readmeio/markdown/issues/2311) [#2298](https://github.com/readmeio/markdown/issues/2298) [#2286](https://github.com/readmeio/markdown/issues/2286) [#2248](https://github.com/readmeio/markdown/issues/2248) * **toc:** prevent misnamed mdx components from breaking TOC ([#1242](#1242)) ([fcb5f7d](fcb5f7d)) <!--SKIP CI-->
## Release notes Sourced from actions/checkout's releases. v6.0.1 What's Changed Update all references from v5 and v4 to v6 by @ericsciple in actions/checkout#2314 Add worktree support for persist-credentials includeIf by @ericsciple in actions/checkout#2327 Clarify v6 README by @ericsciple in actions/checkout#2328 Full Changelog: actions/checkout@v6...v6.0.1 v6.0.0 What's Changed Update README to include Node.js 24 support details and requirements by @salmanmkc in actions/checkout#2248 Persist creds to a separate file by @ericsciple in actions/checkout#2286 v6-beta by @ericsciple in actions/checkout#2298 update readme/changelog for v6 by @ericsciple in actions/checkout#2311 Full Changelog: actions/checkout@v5.0.0...v6.0.0 v6-beta What's Changed Updated persist-credentials to store the credentials under $RUNNER_TEMP instead of directly in the local git config. This requires a minimum Actions Runner version of v2.329.0 to access the persisted credentials for Docker container action scenarios. v5.0.1 What's Changed Port v6 cleanup to v5 by @ericsciple in actions/checkout#2301 Full Changelog: actions/checkout@v5...v5.0.1 ## Changelog Sourced from actions/checkout's changelog. Changelog v6.0.0 Persist creds to a separate file by @ericsciple in actions/checkout#2286 Update README to include Node.js 24 support details and requirements by @salmanmkc in actions/checkout#2248 v5.0.1 Port v6 cleanup to v5 by @ericsciple in actions/checkout#2301 v5.0.0 Update actions checkout to use node 24 by @salmanmkc in actions/checkout#2226 v4.3.1 Port v6 cleanup to v4 by @ericsciple in actions/checkout#2305 v4.3.0 docs: update README.md by @motss in actions/checkout#1971 Add internal repos for checking out multiple repositories by @mouismail in actions/checkout#1977 Documentation update - add recommended permissions to Readme by @benwells in actions/checkout#2043 Adjust positioning of user email note and permissions heading by @joshmgross in actions/checkout#2044 Update README.md by @nebuk89 in actions/checkout#2194 Update CODEOWNERS for actions by @TingluoHuang in actions/checkout#2224 Update package dependencies by @salmanmkc in actions/checkout#2236 v4.2.2 url-helper.ts now leverages well-known environment variables by @jww3 in actions/checkout#1941 Expand unit test coverage for isGhes by @jww3 in actions/checkout#1946 v4.2.1 Check out other refs/* by commit if provided, fall back to ref by @orhantoy in actions/checkout#1924 v4.2.0 Add Ref and Commit outputs by @lucacome in actions/checkout#1180 Dependency updates by @dependabot- actions/checkout#1777, actions/checkout#1872 v4.1.7 Bump the minor-npm-dependencies group across 1 directory with 4 updates by @dependabot in actions/checkout#1739 Bump actions/checkout from 3 to 4 by @dependabot in actions/checkout#1697 Check out other refs/* by commit by @orhantoy in actions/checkout#1774 Pin actions/checkout's own workflows to a known, good, stable version. by @jww3 in actions/checkout#1776 v4.1.6 Check platform to set archive extension appropriately by @cory-miller in actions/checkout#1732 v4.1.5 Update NPM dependencies by @cory-miller in actions/checkout#1703 Bump github/codeql-action from 2 to 3 by @dependabot in actions/checkout#1694 Bump actions/setup-node from 1 to 4 by @dependabot in actions/checkout#1696 Bump actions/upload-artifact from 2 to 4 by @dependabot in actions/checkout#1695 ... (truncated) ## Commits 8e8c483 Clarify v6 README (#2328) 033fa0d Add worktree support for persist-credentials includeIf (#2327) c2d88d3 Update all references from v5 and v4 to v6 (#2314) 1af3b93 update readme/changelog for v6 (#2311) 71cf226 v6-beta (#2298) 069c695 Persist creds to a separate file (#2286) ff7abcd Update README to include Node.js 24 support details and requirements (#2248) See full diff in compare view  Issue-ID: CIMAN-33 Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: onap.gh2gerrit <releng+onap-gh2gerrit@linuxfoundation.org> Change-Id: Ia17690fbdd7b5051af7924f7ce869098d1e2a4fa GitHub-PR: #144 GitHub-Hash: cc3d3cb23d3048ef
Bumps actions/checkout from 5.0.0 to 6.0.1. ## Release notes Sourced from actions/checkout's releases. v6.0.1 What's Changed Update all references from v5 and v4 to v6 by @ericsciple in actions/checkout#2314 Add worktree support for persist-credentials includeIf by @ericsciple in actions/checkout#2327 Clarify v6 README by @ericsciple in actions/checkout#2328 Full Changelog: actions/checkout@v6...v6.0.1 v6.0.0 What's Changed Update README to include Node.js 24 support details and requirements by @salmanmkc in actions/checkout#2248 Persist creds to a separate file by @ericsciple in actions/checkout#2286 v6-beta by @ericsciple in actions/checkout#2298 update readme/changelog for v6 by @ericsciple in actions/checkout#2311 Full Changelog: actions/checkout@v5.0.0...v6.0.0 v6-beta What's Changed Updated persist-credentials to store the credentials under $RUNNER_TEMP instead of directly in the local git config. This requires a minimum Actions Runner version of v2.329.0 to access the persisted credentials for Docker container action scenarios. v5.0.1 What's Changed Port v6 cleanup to v5 by @ericsciple in actions/checkout#2301 Full Changelog: actions/checkout@v5...v5.0.1 ## Changelog Sourced from actions/checkout's changelog. Changelog v6.0.0 Persist creds to a separate file by @ericsciple in actions/checkout#2286 Update README to include Node.js 24 support details and requirements by @salmanmkc in actions/checkout#2248 v5.0.1 Port v6 cleanup to v5 by @ericsciple in actions/checkout#2301 v5.0.0 Update actions checkout to use node 24 by @salmanmkc in actions/checkout#2226 v4.3.1 Port v6 cleanup to v4 by @ericsciple in actions/checkout#2305 v4.3.0 docs: update README.md by @motss in actions/checkout#1971 Add internal repos for checking out multiple repositories by @mouismail in actions/checkout#1977 Documentation update - add recommended permissions to Readme by @benwells in actions/checkout#2043 Adjust positioning of user email note and permissions heading by @joshmgross in actions/checkout#2044 Update README.md by @nebuk89 in actions/checkout#2194 Update CODEOWNERS for actions by @TingluoHuang in actions/checkout#2224 Update package dependencies by @salmanmkc in actions/checkout#2236 v4.2.2 url-helper.ts now leverages well-known environment variables by @jww3 in actions/checkout#1941 Expand unit test coverage for isGhes by @jww3 in actions/checkout#1946 v4.2.1 Check out other refs/* by commit if provided, fall back to ref by @orhantoy in actions/checkout#1924 v4.2.0 Add Ref and Commit outputs by @lucacome in actions/checkout#1180 Dependency updates by @dependabot- actions/checkout#1777, actions/checkout#1872 v4.1.7 Bump the minor-npm-dependencies group across 1 directory with 4 updates by @dependabot in actions/checkout#1739 Bump actions/checkout from 3 to 4 by @dependabot in actions/checkout#1697 Check out other refs/* by commit by @orhantoy in actions/checkout#1774 Pin actions/checkout's own workflows to a known, good, stable version. by @jww3 in actions/checkout#1776 v4.1.6 Check platform to set archive extension appropriately by @cory-miller in actions/checkout#1732 v4.1.5 Update NPM dependencies by @cory-miller in actions/checkout#1703 Bump github/codeql-action from 2 to 3 by @dependabot in actions/checkout#1694 Bump actions/setup-node from 1 to 4 by @dependabot in actions/checkout#1696 Bump actions/upload-artifact from 2 to 4 by @dependabot in actions/checkout#1695 ... (truncated) ## Commits 8e8c483 Clarify v6 README (#2328) 033fa0d Add worktree support for persist-credentials includeIf (#2327) c2d88d3 Update all references from v5 and v4 to v6 (#2314) 1af3b93 update readme/changelog for v6 (#2311) 71cf226 v6-beta (#2298) 069c695 Persist creds to a separate file (#2286) ff7abcd Update README to include Node.js 24 support details and requirements (#2248) See full diff in compare view  Issue-ID: CIMAN-33 Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: oran.gh2gerrit <releng+oran-gh2gerrit@linuxfoundation.org> Change-Id: Ia4bac075a7a226ab56f034a9146dd2c6aa0388c7 GitHub-PR: #22 GitHub-Hash: 0818aece280962df
### What changes were proposed in this pull request? This PR aims to upgrade `actions/checkout` to v6. ### Why are the changes needed? To use more secure version: - actions/checkout#2286 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #430 from dongjoon-hyun/SPARK-54680. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
### What changes were proposed in this pull request? This PR aims to upgrade `actions/checkout` to v6. ### Why are the changes needed? To use more secure version: - actions/checkout#2286 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #265 from dongjoon-hyun/SPARK-54681. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
This reverts commit 069c695.
This reverts commit 069c695.
Updates actions/checkout across all actions for new features and improvements. Changes in v6.0.1: - Update all references from v5 and v4 to v6 by @ericsciple in #2314 - Add worktree support for persist-credentials includeIf by @ericsciple in #2327 - Clarify v6 README by @ericsciple in #2328 - Update README to include Node.js 24 support details and requirements by @salmanmkc in actions/checkout#2248 - Persist creds to a separate file by @ericsciple in actions/checkout#2286 - v6-beta by @ericsciple in actions/checkout#2298 - update readme/changelog for v6 by @ericsciple in actions/checkout#2311 Addresses Dependabot PR: #3373 Signed-off-by: Rael Garcia <rael@redhat.com>
Updates actions/checkout across all actions for new features and improvements. Changes in v6.0.1: - Update all references from v5 and v4 to v6 by @ericsciple in #2314 - Add worktree support for persist-credentials includeIf by @ericsciple in #2327 - Clarify v6 README by @ericsciple in #2328 - Update README to include Node.js 24 support details and requirements by @salmanmkc in actions/checkout#2248 - Persist creds to a separate file by @ericsciple in actions/checkout#2286 - v6-beta by @ericsciple in actions/checkout#2298 - update readme/changelog for v6 by @ericsciple in actions/checkout#2311 Addresses Dependabot PR: #3373 Signed-off-by: Rael Garcia <rael@redhat.com>
No description provided.