mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-10 03:13:23 +00:00
Merge pull request #40 from nikolai-frolov/remove-token-usage
Remove Access Token usage
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
param (
|
param (
|
||||||
[Parameter(Mandatory)][string] $ManifestPath,
|
[Parameter(Mandatory)][string] $ManifestPath
|
||||||
[string] $AccessToken
|
|
||||||
)
|
)
|
||||||
|
|
||||||
$Global:validationFailed = $false
|
$Global:validationFailed = $false
|
||||||
@@ -20,12 +19,11 @@ function Publish-Error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Test-DownloadUrl {
|
function Test-DownloadUrl {
|
||||||
param([string] $DownloadUrl)
|
param(
|
||||||
|
[string] $DownloadUrl
|
||||||
|
)
|
||||||
|
|
||||||
$request = [System.Net.WebRequest]::Create($DownloadUrl)
|
$request = [System.Net.WebRequest]::Create($DownloadUrl)
|
||||||
if ($AccessToken) {
|
|
||||||
$authorizationHeaderValue = "Basic $AccessToken"
|
|
||||||
$request.Headers.Add("Authorization", $authorizationHeaderValue)
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
$response = $request.GetResponse()
|
$response = $request.GetResponse()
|
||||||
return ([int]$response.StatusCode -eq 200)
|
return ([int]$response.StatusCode -eq 200)
|
||||||
|
|||||||
Reference in New Issue
Block a user