File tree Expand file tree Collapse file tree
packages/http-client-csharp/eng/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -689,20 +689,12 @@ try {
689689 throw " Failed to commit changes"
690690 }
691691
692- # Refresh the GitHub App installation token immediately before pushing.
693- # Installation tokens are valid for only 1 hour; regenerating Azure data-plane
694- # and/or mgmt SDK libraries above can exceed this window, causing the original
695- # token to be expired by push time. login-to-github.ps1 mints a fresh
696- # installation token via Azure Key Vault (az CLI auth from the prior
697- # AzureCLI@2-based login-to-github.yml step persists across tasks in the same
698- # job via ~/.azure). The refreshed token is exported as $env:GH_TOKEN, which
699- # is also picked up by `gh pr create` below.
700692 $loginScript = Join-Path $PSScriptRoot " ../../../../eng/common/scripts/login-to-github.ps1"
701693 if (Test-Path $loginScript ) {
702694 Write-Host " Refreshing GitHub App installation token before push..."
703695 try {
704696 & $loginScript - InstallationTokenOwners @ ($RepoOwner )
705- if ($LASTEXITCODE -eq 0 -and $ env : GH_TOKEN ) {
697+ if ($LASTEXITCODE -eq 0 -and ( Test-Path Env :GH_TOKEN) ) {
706698 $AuthToken = $env: GH_TOKEN
707699 Write-Host " GitHub App installation token refreshed."
708700 } else {
You can’t perform that action at this time.
0 commit comments