Sync eng/common directory with azure-sdk-tools repository (#1418)

This commit is contained in:
Azure SDK Bot 2021-01-20 15:37:08 -08:00 committed by GitHub
parent 2fe1ab8a4b
commit aae5fc8186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,33 @@
param(
$Repository,
$Tag,
$AuthToken
)
. (Join-Path $PSScriptRoot common.ps1)
$repositoryParts = $Repository.Split("/")
if ($repositoryParts.Length -ne 2)
{
LogError "Repository is not a valid format."
}
$repositoryOwner = $repositoryParts[0]
LogDebug "Repository owner is: $repositoryOwner"
$repositoryName = $repositoryParts[1]
LogDebug "Reposiory name is: $repositoryName"
$ref = "tags/$Tag"
LogDebug "Calculated ref is: $ref"
try
{
Remove-GitHubSourceReferences -RepoOwner $repositoryOwner -RepoName $repositoryName -Ref $ref -AuthToken $AuthToken
}
catch
{
LogError "Remove-GitHubSourceReferences failed with exception:`n$_"
exit 1
}