-
-
Notifications
You must be signed in to change notification settings - Fork 15
27 lines (25 loc) · 870 Bytes
/
pr_check.yml
File metadata and controls
27 lines (25 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# This workflow checks if a pull request is labeled with "do not merge" or "WIP" and fails any jobs if the tag exists.
name: 'Check PR Merge'
permissions:
contents: read
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- edited
- labeled
- unlabeled
jobs:
fail-by-label:
if: contains(github.event.pull_request.labels.*.name, 'do not merge') || contains(github.event.pull_request.labels.*.name, 'WIP')
runs-on: ubuntu-latest
steps:
- name: Fail if PR is labeled "do not merge" or "WIP"
# This step will fail the job if the PR has the "do not merge" or "WIP" label.
run: |
echo "This PR is labeled 'do not merge' or 'WIP'. Please remove the label to proceed with merging."
exit 1