Skip to content

Commit

Permalink
.github/workflows - new workflow (elastic#12631)
Browse files Browse the repository at this point in the history
Add new temporary workflow to prevent changes to specific
integration files from being changed.
  • Loading branch information
andrewkroh authored Feb 5, 2025
1 parent f728ca7 commit 9576ef5
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/block-paths.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Block Changes

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
check-blocked-paths:
name: Check for blocked path changes
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for blocked path changes
run: |
BLOCKED_PATHS=(
"packages/akamai/data_stream/siem/_dev/test/pipeline/"
"packages/cisco_ise/data_stream/log/_dev/test/pipeline/"
)
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
# Check if any blocked path is in the changed files.
for blocked_path in "${BLOCKED_PATHS[@]}"; do
if echo "$CHANGED_FILES" | grep -q "^$blocked_path"; then
msg="❌ ERROR: Changes to files in '$blocked_path' are currently not allowed! See @norrietaylor for details."
echo "$msg"
echo "$msg" >> $GITHUB_STEP_SUMMARY
exit 1
fi
done
echo "✅ No blocked paths were modified."
echo "✅ No blocked paths were modified." >> $GITHUB_STEP_SUMMARY

0 comments on commit 9576ef5

Please sign in to comment.