File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Block Changes
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened]
6+
7+ jobs :
8+ check-blocked-paths :
9+ name : Check for blocked path changes
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0
16+
17+ - name : Check for blocked path changes
18+ run : |
19+ BLOCKED_PATHS=(
20+ "packages/akamai/data_stream/siem/_dev/test/pipeline/"
21+ "packages/cisco_ise/data_stream/log/_dev/test/pipeline/"
22+ )
23+
24+ CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
25+
26+ # Check if any blocked path is in the changed files.
27+ for blocked_path in "${BLOCKED_PATHS[@]}"; do
28+ if echo "$CHANGED_FILES" | grep -q "^$blocked_path"; then
29+ msg="❌ ERROR: Changes to files in '$blocked_path' are currently not allowed! See @norrietaylor for details."
30+ echo "$msg"
31+ echo "$msg" >> $GITHUB_STEP_SUMMARY
32+ exit 1
33+ fi
34+ done
35+
36+ echo "✅ No blocked paths were modified."
37+ echo "✅ No blocked paths were modified." >> $GITHUB_STEP_SUMMARY
You can’t perform that action at this time.
0 commit comments