Skip to content

Commit

Permalink
check PR labels
Browse files Browse the repository at this point in the history
Signed-off-by: ozkanonur <[email protected]>
  • Loading branch information
onur-ozkan committed Jun 26, 2023
1 parent 08bfef7 commit ce45619
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- opened
- edited
- synchronize
pull_request_target:
types:
- labeled
- unlabeled

jobs:
main:
Expand Down Expand Up @@ -40,3 +44,13 @@ jobs:
echo "PR title is too long (greater than 72 characters)"
exit 1
fi
- name: Check PR labels
run: |
if [[ ! "${{ github.event.pull_request.labels }}" =~ "under-review" && ! "${{ github.event.pull_request.labels }}" =~ "in-progress" ]]; then
echo "PR must have at least one of the labels 'under-review' or 'in-progress'."
exit 1
elif [[ "${{ github.event.pull_request.labels }}" =~ "under-review" && "${{ github.event.pull_request.labels }}" =~ "in-progress" ]]; then
echo "PR cannot have both 'under-review' and 'in-progress' labels at the same time."
exit 1
fi

0 comments on commit ce45619

Please sign in to comment.