Skip to content

Commit

Permalink
fix: rewrite misspelled URL to PR, for PR labeling automation (#3018)
Browse files Browse the repository at this point in the history
On PR created trigger, GH provides the URL to the PR through the
'github.event.pull_request.url' variable. Unfortunately, there is a
spelling issue in it: it has an "s" too much in it (pulls instead of
pull), see 'https://github.com/Azure/bicep-registry-modules/pulls/3016'.
Because of that, the PR labeling logic fail, a it can't find the PR
  • Loading branch information
rahalan authored Aug 9, 2024
1 parent d3b5f12 commit 7ec79ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions avm/utilities/pipelines/platform/Set-AvmGitHubPrLabels.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ function Set-AvmGitHubPrLabels {
. (Join-Path $RepoRoot 'avm' 'utilities' 'pipelines' 'platform' 'helper' 'Get-GithubTeamMembersLogin.ps1')
. (Join-Path $RepoRoot 'avm' 'utilities' 'pipelines' 'platform' 'helper' 'Get-AvmCsvData.ps1')

$pr = gh pr view $PrUrl.Replace('api.', '').Replace('repos/', '') --json 'author,title,url,body,comments' --repo $Repo | ConvertFrom-Json -Depth 100
$allTeamNames = [array](Get-GithubPrRequestedReviewerTeamNames -PrUrl $PrUrl.Replace('api.', '').Replace('repos/', ''))
$sanitizedPrUrl = $PrUrl.Replace('api.', '').Replace('repos/', '').Replace('pulls/', 'pull/')
$pr = gh pr view $sanitizedPrUrl --json 'author,title,url,body,comments' --repo $Repo | ConvertFrom-Json -Depth 100
$allTeamNames = [array](Get-GithubPrRequestedReviewerTeamNames -PrUrl $sanitizedPrUrl)
$teamNames = [array]($allTeamNames | Where-Object { $_ -ne 'bicep-admins' -and $_ -ne 'avm-core-team-technical-bicep' -and $_ -ne 'avm-module-reviewers-bicep' })

# core team is already assigned, no or more than one module reviewer team is assigned
Expand Down

0 comments on commit 7ec79ac

Please sign in to comment.