Skip to content
28 changes: 28 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Check Label

on:
pull_request:
types:
- opened
- labeled
- unlabeled
- synchronized

jobs:
ready-to-merge:
runs-on: ubuntu-latest

steps:
- name: Fail if PR is not labelled as ready to merge
if: "!contains(github.event.pull_request.labels.*.name,'ready to merge')"
run: |
echo "This PR is not yet ready to merge."
exit 1

- name: Pass if PR is labelled as ready to merge
if: |
github.ref == 'pull_request' &&
contains(github.event.pull_request.labels.*.name,'ready to merge')
run: echo "This PR is ready to merge."

Loading