mirror of
https://github.com/actions/checkout.git
synced 2026-05-23 01:55:54 +00:00
feat: support custom SSH user in git auth configuration
- Allow sshUser setting to override default 'git' user in insteadOf config - When sshUser is empty, default to 'git@github.com' - When sshUser is provided (e.g., 'customuser'), use 'customuser@github.com' - Updated tests to verify custom SSH user behavior in auth configuration Co-Authored-By: Claude:Qwen3-Coder-Next-4bit
This commit is contained in:
parent
900f2210b1
commit
ed390c1672
3 changed files with 94 additions and 2 deletions
5
dist/index.js
vendored
5
dist/index.js
vendored
|
|
@ -174,7 +174,10 @@ class GitAuthHelper {
|
|||
this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
|
||||
// Instead of SSH URL
|
||||
this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
|
||||
this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
|
||||
const sshUser = this.settings.sshUser && this.settings.sshUser.length > 0
|
||||
? this.settings.sshUser
|
||||
: 'git';
|
||||
this.insteadOfValues.push(`${sshUser}@${serverUrl.hostname}:`);
|
||||
if (this.settings.workflowOrganizationId) {
|
||||
this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue