Skip to content

Commit

Permalink
Switched back to gh for getting *current* labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
grigorye committed Jun 27, 2023
1 parent 7bf6ce9 commit 9cce7a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ jobs:
should_run=false
fi
else
labels=($(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH"))
PR_NUMBER=${{ github.event.pull_request.number }}
labels=($(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json labels --jq .labels.[].name))
if [[ " ${labels[@]} " =~ "ci: $action" ]]; then
printf -v "should_run" "%s" "true" # https://stackoverflow.com/a/16973754/1859783
else
Expand Down Expand Up @@ -71,7 +72,8 @@ jobs:
should_run=false
fi
else
labels=($(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH"))
PR_NUMBER=${{ github.event.pull_request.number }}
labels=($(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json labels --jq .labels.[].name))
if [[ " ${labels[@]} " =~ "ci: $action" ]]; then
printf -v "should_run" "%s" "true" # https://stackoverflow.com/a/16973754/1859783
else
Expand Down

0 comments on commit 9cce7a6

Please sign in to comment.