aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/check-mergable-by-label.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/.github/workflows/check-mergable-by-label.yml b/.github/workflows/check-mergable-by-label.yml
new file mode 100644
index 00000000..db40f025
--- /dev/null
+++ b/.github/workflows/check-mergable-by-label.yml
@@ -0,0 +1,31 @@
+name: PR Labels
+
+on:
+ pull_request:
+ types:
+ - opened
+ - reopened
+ - synchronize
+ - edited
+ - labeled
+ - unlabeled
+
+permissions: {}
+
+jobs:
+ fail-by-blocking-label:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check for blocking labels
+ run: |
+ BLOCKING_LABELS=("do NOT merge yet" "s: on hold")
+ PR_LABELS=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH")
+
+ for LABEL in "${BLOCKING_LABELS[@]}"; do
+ if [[ "$PR_LABELS" == *"$LABEL"* ]]; then
+ echo "This PR has a blocking label: $LABEL"
+ exit 1
+ fi
+ done
+
+ echo "No blocking labels found"