Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/pr-metadata-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,14 @@ jobs:
fi

# Block PRs with labels that indicate they are not ready to merge.
BLOCKED_PATTERNS="blocked DO NOT MERGE do not merge"
for label in $LABEL_NAMES; do
for pattern in $BLOCKED_PATTERNS; do
if echo "$label" | grep -qi "$pattern"; then
ERRORS="${ERRORS}- **Blocked label detected**: label \`$label\` prevents merging. Remove it when the PR is ready.\n"
break
fi
done
done
# Read labels line-by-line (jq outputs one per line) to handle
# multi-word label names; match with a single regex to avoid
# word-splitting "DO NOT MERGE" into individual grep patterns.
while IFS= read -r label; do
if echo "$label" | grep -qiE "blocked|do not merge"; then
ERRORS="${ERRORS}- **Blocked label detected**: label \`$label\` prevents merging. Remove it when the PR is ready.\n"
fi
done < <(echo "$LABELS" | jq -r '.[].name')
Comment thread
rwgk marked this conversation as resolved.
Outdated

if [ -n "$ERRORS" ]; then
echo "::error::This PR is missing required metadata. See the job summary for details."
Expand Down
Loading