Skip to content

[Test] Test stabilization fixes for 3.16.1: patchibng, build-image no-internet, multi_az_fsx #4599

[Test] Test stabilization fixes for 3.16.1: patchibng, build-image no-internet, multi_az_fsx

[Test] Test stabilization fixes for 3.16.1: patchibng, build-image no-internet, multi_az_fsx #4599

name: Unsafe Patterns Checker
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
jobs:
bad-url-suffix-check:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-bad-url-suffix-check') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for disallowed URL suffixes in added lines
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
if git diff "origin/${BASE_REF}...HEAD" | grep "^+" | grep -qP 'amazonaws\.com|amazonaws\.com\.cn|c2s\.ic\.gov|sc2s\.sgov\.gov'; then
echo "::error::Found disallowed URL suffixes in added lines"
git diff "origin/${BASE_REF}...HEAD" | grep "^+" | grep -P 'amazonaws\.com|amazonaws\.com\.cn|c2s\.ic\.gov|sc2s\.sgov\.gov'
exit 1
fi