Skip to content

Commit

Permalink
Add a git action to process the event of pr labeled
Browse files Browse the repository at this point in the history
  • Loading branch information
wyunchi-ms committed Jul 11, 2023
1 parent 6939348 commit 4fa3a28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
with:
sparse-checkout: |
.github
- name: test
- name: process label
shell: pwsh
run: .github/workflows/script/PrLabeled.ps1 -LabelName "${{ github.event.label.name }}" -PrUrl $PR
2 changes: 1 addition & 1 deletion .github/workflows/script/PrLabeled.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Test-LabelCommentIsAlreadyAdded {
[System.String]
$PrUrl
)
$existingComments = gh pr view $PrUrl --json comments | ConvertFrom-Json | Where-Object { $_.body -eq $comment }
$existingComments = (gh pr view $PrUrl --json comments | ConvertFrom-Json).comments | Where-Object { $_.body -eq $comment }
if ($existingComments.Count -gt 0) {
return $true
}
Expand Down

0 comments on commit 4fa3a28

Please sign in to comment.