forked from elastic/integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github/workflows - new workflow (elastic#12631)
Add new temporary workflow to prevent changes to specific integration files from being changed.
- Loading branch information
1 parent
f728ca7
commit 9576ef5
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |