Skip to content

Commit 079c558

Browse files
authored
normalize-sharing-prompts-during-iteration (#1729)
1 parent 7aa67e5 commit 079c558

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Block remove-before-merge paths"
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
merge_group:
7+
8+
permissions:
9+
pull-requests: read
10+
11+
jobs:
12+
check-paths:
13+
name: "No remove-before-merge directories"
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check for remove-before-merge paths in PR
17+
env:
18+
GH_TOKEN: ${{ github.token }}
19+
PR_NUMBER: ${{ github.event.pull_request.number }}
20+
REPO: ${{ github.repository }}
21+
run: |
22+
FILES=$(gh api repos/$REPO/pulls/$PR_NUMBER/files --paginate --jq '.[].filename')
23+
BLOCKED=$(echo "$FILES" | grep -E '(^|/)[-a-zA-Z0-9_]+-remove-before-merge(/|$)' || true)
24+
if [ -n "$BLOCKED" ]; then
25+
echo "::error::This PR contains files under a 'remove-before-merge' directory. Remove them before merging."
26+
echo ""
27+
echo "Offending paths:"
28+
echo "$BLOCKED"
29+
exit 1
30+
fi
31+
echo "No remove-before-merge paths found. ✅"

0 commit comments

Comments
 (0)