Skip to content

Commit 9576ef5

Browse files
authored
.github/workflows - new workflow (elastic#12631)
Add new temporary workflow to prevent changes to specific integration files from being changed.
1 parent f728ca7 commit 9576ef5

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/block-paths.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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

0 commit comments

Comments
 (0)