From 4f95121a272a735d930d506c0a7b77c052156093 Mon Sep 17 00:00:00 2001 From: ahmdkaml Date: Fri, 14 Aug 2026 15:48:12 +0300 Subject: [PATCH 1/2] Run safety checks on direct pushes to main --- .github/workflows/frozen-files.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/frozen-files.yml b/.github/workflows/frozen-files.yml index 21d8d03..15bca42 100644 --- a/.github/workflows/frozen-files.yml +++ b/.github/workflows/frozen-files.yml @@ -24,13 +24,18 @@ jobs: # Diff against the merge-base, not the base branch tip directly - # a two-dot diff (base_sha..head_sha) can include files main picked # up after this PR branched, which aren't actually part of the PR. - merge_base="$(git merge-base \ - "${{ github.event.pull_request.base.sha }}" \ - "${{ github.event.pull_request.head.sha }}")" - changed_files="$(git diff --name-only \ - "$merge_base" \ - "${{ github.event.pull_request.head.sha }}")" - + if [ "${{ github.event_name }}" = "pull_request" ]; then + merge_base="$(git merge-base \ + "${{ github.event.pull_request.base.sha }}" \ + "${{ github.event.pull_request.head.sha }}")" + changed_files="$(git diff --name-only \ + "$merge_base" \ + "${{ github.event.pull_request.head.sha }}")" + else + changed_files="$(git diff --name-only \ + "${{ github.event.before }}" \ + "${{ github.sha }}")" + fi blocked="" while IFS= read -r file; do @@ -75,7 +80,7 @@ jobs: done <<< "$changed_files" if [ -n "$blocked" ]; then - echo "::error::This PR modifies files protected by CLAUDE.md ยง1." + echo "::error::Protected files were modified." echo echo "Protected files:" printf "%s" "$blocked" From b17783122d4d064f82fde41c3216592f777e90eb Mon Sep 17 00:00:00 2001 From: ahmdkaml Date: Fri, 14 Aug 2026 15:52:13 +0300 Subject: [PATCH 2/2] Run safety checks on direct pushes to main --- .github/workflows/build-explainers.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-explainers.yml b/.github/workflows/build-explainers.yml index 8a6451b..1b8943f 100644 --- a/.github/workflows/build-explainers.yml +++ b/.github/workflows/build-explainers.yml @@ -15,6 +15,11 @@ name: Build Explainers on: push: branches: [main] + paths: + - "explainers/**.md" + - "assets/explainers-data.json" + - "scripts/build_explainers.py" + - "scripts/generate_og_images.py" pull_request: paths: - "explainers/**.md" @@ -35,7 +40,7 @@ jobs: python-version: "3.11" - name: Install Pillow (OG image generation) - run: python -m pip install --upgrade pip pillow + run: python -m pip install --upgrade pip "pillow==11.1.0" - name: Generate explainer pages, data.js, and sitemap run: python3 scripts/build_explainers.py