File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
eng/common/scripts/Helpers Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,14 @@ function isNewVersion(
108
108
function Get-GitHubApiHeaders {
109
109
# Use GitHub cli to get an auth token if available
110
110
if (Get-Command gh - ErrorAction SilentlyContinue) {
111
- $token = gh auth token 2> $null
111
+ try
112
+ {
113
+ $token = gh auth token 2> $null
114
+ }
115
+ catch
116
+ {
117
+ Write-Host " Failed to get GitHub CLI auth token."
118
+ }
112
119
}
113
120
114
121
# Get token from env if not available from gh cli
@@ -122,7 +129,7 @@ function Get-GitHubApiHeaders {
122
129
{
123
130
Write-Host " Using authenticated GitHub API requests."
124
131
$headers = @ {
125
- Authorization = " Bearer $tokentest "
132
+ Authorization = " Bearer $token "
126
133
}
127
134
return $headers
128
135
}
You can’t perform that action at this time.
0 commit comments