File tree Expand file tree Collapse file tree 1 file changed +7
-24
lines changed Expand file tree Collapse file tree 1 file changed +7
-24
lines changed Original file line number Diff line number Diff line change 3838}
3939catch
4040{
41+ $result = $_.Exception.Response.GetResponseStream ()
42+ $reader = New-Object System.IO.StreamReader($result )
43+ $reader.BaseStream.Position = 0
44+ $reader.DiscardBufferedData ()
45+ $responseBody = $reader.ReadToEnd ()
4146
42- # assume exception is with try with GITHUB_TOKEN
43- if ($env: GITHUB_TOKEN )
44- {
45- Write-Output " INFO: 2nd try using GITHUB TOKEN"
46-
47- # authorization header with github token
48- $auth = " Bearer $env: GITHUB_TOKEN "
49-
50- $webClient.Headers.Remove (" Authorization" )
51- $webClient.Headers.Add (" Authorization" , $auth )
52-
53- $releaseList = $webClient.DownloadString (' https://api.github.com/repos/nanoframework/nf-Visual-Studio-extension/releases?per_page=100' )
54- }
55- else
56- {
57- $result = $_.Exception.Response.GetResponseStream ()
58- $reader = New-Object System.IO.StreamReader($result )
59- $reader.BaseStream.Position = 0
60- $reader.DiscardBufferedData ()
61- $responseBody = $reader.ReadToEnd ()
62-
63- Write-Output " 🛑 performing request: $responseBody "
64- exit 1
65- }
47+ Write-Output " 🛑 performing request: $responseBody "
48+ exit 1
6649}
6750
6851if ($releaseList -match ' \"(?<VS2022_version>v2022\.\d+\.\d+\.\d+)\"' )
You can’t perform that action at this time.
0 commit comments