[Logstash] Adding Health Report to Logstash Integration #160
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
name: Block Changes | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
check_suite: | |
types: [completed] | |
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 |