Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: check mergable by label #2405

Merged
merged 12 commits into from Sep 20, 2023
31 changes: 31 additions & 0 deletions .github/workflows/check-mergable-by-label.yml
Shinigami92 marked this conversation as resolved.
Show resolved Hide resolved
@@ -0,0 +1,31 @@
name: PR Labels

on:
pull_request:
types:
- opened
- reopened
- synchronize
- edited
Shinigami92 marked this conversation as resolved.
Show resolved Hide resolved
- 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"