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 (
|
||||
[Parameter(Mandatory)][string] $ManifestPath,
|
||||
[string] $AccessToken
|
||||
[Parameter(Mandatory)][string] $ManifestPath
|
||||
)
|
||||
|
||||
$Global:validationFailed = $false
|
||||
@@ -20,12 +19,11 @@ function Publish-Error {
|
||||
}
|
||||
|
||||
function Test-DownloadUrl {
|
||||
param([string] $DownloadUrl)
|
||||
param(
|
||||
[string] $DownloadUrl
|
||||
)
|
||||
|
||||
$request = [System.Net.WebRequest]::Create($DownloadUrl)
|
||||
if ($AccessToken) {
|
||||
$authorizationHeaderValue = "Basic $AccessToken"
|
||||
$request.Headers.Add("Authorization", $authorizationHeaderValue)
|
||||
}
|
||||
try {
|
||||
$response = $request.GetResponse()
|
||||
return ([int]$response.StatusCode -eq 200)
|
||||
|
||||
Reference in New Issue
Block a user