Skip to content

fix(aws): align Kueue batch memory with EKS allocatable + safety margin #95

fix(aws): align Kueue batch memory with EKS allocatable + safety margin

fix(aws): align Kueue batch memory with EKS allocatable + safety margin #95

name: Protect synced folder
on:
pull_request:
branches: [main]
jobs:
check-protected-folder:
runs-on: ubuntu-latest
steps:
- name: Check for unauthorized changes
if: github.actor != 'github-actions[bot]'
env:
GH_TOKEN: ${{ github.token }}
run: |
PROTECTED_FOLDERS="charts/platforma infrastructure/aws"
CHANGED_FILES=$(gh api \
"repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" \
--paginate --jq '.[].filename')
VIOLATIONS=""
for FOLDER in ${PROTECTED_FOLDERS}; do
FOLDER_VIOLATIONS=$(echo "${CHANGED_FILES}" | grep "^${FOLDER}/" || true)
if [ -n "${FOLDER_VIOLATIONS}" ]; then
VIOLATIONS="${VIOLATIONS}${FOLDER_VIOLATIONS}"$'\n'
fi
done
if [ -n "${VIOLATIONS}" ]; then
echo "::error::Changes to synced folders are only allowed from the sync bot."
echo ""
echo "The following files were modified:"
echo "${VIOLATIONS}"
echo ""
echo "These folders are managed automatically. Please do not modify them directly."
exit 1
fi
echo "No unauthorized changes to synced folders."