Skip to content

Persist creds to a separate file#2286

Merged
ericsciple merged 1 commit intomainfrom
users/ericsciple/25-10-cred
Nov 3, 2025
Merged

Persist creds to a separate file#2286
ericsciple merged 1 commit intomainfrom
users/ericsciple/25-10-cred

Conversation

@ericsciple
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
Comment thread src/git-auth-helper.ts
@ericsciple ericsciple force-pushed the users/ericsciple/25-10-cred branch from a370417 to eddff11 Compare October 17, 2025 19:00
@ericsciple ericsciple marked this pull request as ready for review October 17, 2025 19:00
Copilot AI review requested due to automatic review settings October 17, 2025 19:00
Copy link
Copy Markdown
Contributor

Copilot AI left a 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/config to a separate file in RUNNER_TEMP
  • Uses Git's includeIf.gitdir feature 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_AcceptsGitHubServerUrlSetToGHEC doesn't match the test description 'inject https://github.com as github server url'. Consider using a more descriptive name like configureAuth_AcceptsGitHubServerUrl to 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.

Comment thread src/git-auth-helper.ts
Comment thread __test__/git-auth-helper.test.ts
Comment thread .github/workflows/test.yml
Comment thread .github/workflows/test.yml
@ericsciple ericsciple force-pushed the users/ericsciple/25-10-cred branch from eddff11 to cb17bfb Compare October 20, 2025 18:56
@ericsciple ericsciple merged commit 069c695 into main Nov 3, 2025
12 checks passed
@ericsciple ericsciple deleted the users/ericsciple/25-10-cred branch November 3, 2025 19:08
luketainton pushed a commit to luketainton/repos_roboluke that referenced this pull request Nov 20, 2025
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 [@&#8203;salmanmkc](https://github.com/salmanmkc) in [#&#8203;2248](actions/checkout#2248)
- Persist creds to a separate file by [@&#8203;ericsciple](https://github.com/ericsciple) in [#&#8203;2286](actions/checkout#2286)
- v6-beta by [@&#8203;ericsciple](https://github.com/ericsciple) in [#&#8203;2298](actions/checkout#2298)
- update readme/changelog for v6 by [@&#8203;ericsciple](https://github.com/ericsciple) in [#&#8203;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>
luketainton pushed a commit to luketainton/repos_epage that referenced this pull request Nov 20, 2025
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 [@&#8203;salmanmkc](https://github.com/salmanmkc) in [#&#8203;2248](actions/checkout#2248)
- Persist creds to a separate file by [@&#8203;ericsciple](https://github.com/ericsciple) in [#&#8203;2286](actions/checkout#2286)
- v6-beta by [@&#8203;ericsciple](https://github.com/ericsciple) in [#&#8203;2298](actions/checkout#2298)
- update readme/changelog for v6 by [@&#8203;ericsciple](https://github.com/ericsciple) in [#&#8203;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>
kodiakhq Bot pushed a commit to pdylanross/fatigue that referenced this pull request Nov 21, 2025
Bumps actions/checkout from 5 to 6.

Release notes
Sourced from actions/checkout's releases.

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

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




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 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 <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants