Skip to content

Commit

Permalink
🩹 [Patch]: Restore sshUser assignment and fix GitHub URL configuratio…
Browse files Browse the repository at this point in the history
…n for proper syntax
  • Loading branch information
MariusStorhaug committed Jan 17, 2025
1 parent 3667ca8 commit 1922c6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/functions/public/Git/Set-GitHubGitConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@
$token = $Context.Token | ConvertFrom-SecureString -AsPlainText
$hostName = $Context.HostName
$installationName = $Context.InstallationName
# $sshUser = $Context.Enterprise ?? 'git'
$sshUser = $Context.Enterprise ?? 'git'

if ($PSCmdlet.ShouldProcess("$username on $installationName", 'Set Git configuration')) {
$git = 'git'
@(
@('config', '--global', 'user.name', "$username"),
@('config', '--global', 'user.email', "$id+$username@users.noreply.github.com"),
# @('config', '--global', '--add', "url.""https://oauth2:$token@$hostName/$installationName"".insteadOf",
# "ssh://$sshUser@$hostName`:$installationName"),
@('config', '--global', '--add', "url.""https://oauth2:$token@$hostName/$installationName"".insteadOf",
@('config', '--global', '--add', "url.https://oauth2:$token@$hostName/$installationName.insteadOf",
"ssh://$sshUser@$hostName`:$installationName"),
@('config', '--global', '--add', "url.https://oauth2:$token@$hostName/$installationName.insteadOf",
"https://$hostName/$installationName")
) | ForEach-Object {
Write-Verbose "$git $($_ -join ' ')"
Expand Down

0 comments on commit 1922c6f

Please sign in to comment.