forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync eng/common directory with azure-sdk-tools for PR 9656 (Azure#39356)
* Added label handle sdk-gen pipeline template Added common script to delete label from a PR * Update eng/common/scripts/Invoke-GitHubAPI.ps1 Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> --------- Co-authored-by: ray chen <raychen@microsoft.com> Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
- Loading branch information
1 parent
d80bcf3
commit b5d45cc
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[CmdletBinding(SupportsShouldProcess = $true)] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[string]$RepoOwner, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$RepoName, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$IssueNumber, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$LabelName, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$AuthToken | ||
) | ||
|
||
. (Join-Path $PSScriptRoot common.ps1) | ||
|
||
try { | ||
Remove-GitHubIssueLabel -RepoOwner $RepoOwner -RepoName $RepoName ` | ||
-IssueNumber $IssueNumber -LabelName $LabelName -AuthToken $AuthToken | ||
} | ||
catch { | ||
if ($_.Exception.Response.StatusCode -eq 404) { | ||
LogWarning "Label $LabelName not found on issue" | ||
exit 0 | ||
} | ||
LogError "Remove-GithubIssueLabel failed with exception:`n$_" | ||
exit 1 | ||
} |