Skip to content

Commit cbcb841

Browse files
committed
add pr label check
1 parent c7e6dbe commit cbcb841

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check Label on PR
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, labeled, unlabeled]
5+
6+
jobs:
7+
check_pr_label:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout PR
11+
uses: actions/checkout@v6
12+
with:
13+
fetch-depth: 0 # Fetch all history for all branches and tags
14+
15+
- name: Check if the PR contains the label validation or no validation
16+
id: check_pr_label
17+
if: |
18+
! contains( github.event.pull_request.labels.*.name, 'validation') && ! contains( github.event.pull_request.labels.*.name, 'no validation')
19+
run: |
20+
echo "Neither 'validation' nor 'no validation' labels are present."
21+
exit 1 # Exit with a failure

0 commit comments

Comments
 (0)