mirror of
https://github.com/actions/checkout.git
synced 2026-05-22 12:01:53 +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
|
|
@ -65,7 +65,11 @@ class GitAuthHelper {
|
|||
|
||||
// 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