Skip to content

Commit

Permalink
build: check for PR labels (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Jul 9, 2024
1 parent 32e22ec commit b96527b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check PR Label

on:
pull_request:
types: [opened, edited, labeled, unlabeled]

jobs:
check-label:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Check if PR has labels
id: check_labels
run: |
labels=$(jq -r '.pull_request.labels | length' $GITHUB_EVENT_PATH)
if [ "$labels" -eq 0 ]; then
echo "No labels found on the PR"
exit 1
fi
- name: Set status
if: failure()
run: echo "Please add at least one label to the Pull Request."

0 comments on commit b96527b

Please sign in to comment.