Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/site-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
fetch-depth: 2
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
Expand All @@ -39,10 +39,8 @@ jobs:
# frozen, so only edits and deletions inside an existing one are rejected.
- name: Reject edits to a frozen snapshot
if: github.event_name == 'pull_request'
env:
BASE: ${{ github.event.pull_request.base.sha }}
run: |
edited=$(git diff --diff-filter=MD --name-only "$BASE...HEAD" -- 'docs/site/docs-v*' 'docs/site/docs-fr-v*')
edited=$(git diff --diff-filter=MD --name-only HEAD^1 HEAD -- 'docs/site/docs-v*' 'docs/site/docs-fr-v*')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (pre-existing, not introduced here): rename detection is on by default, so a file renamed within a frozen snapshot comes out as R and is filtered away by --diff-filter=MD. git mv docs/site/docs-v5/intro.md docs/site/docs-v5/getting-started.md currently passes the check even though the frozen page is gone from its old URL. --no-renames splits it back into A+D and the D is caught.

Suggested change
edited=$(git diff --diff-filter=MD --name-only HEAD^1 HEAD -- 'docs/site/docs-v*' 'docs/site/docs-fr-v*')
edited=$(git diff --no-renames --diff-filter=MD --name-only HEAD^1 HEAD -- 'docs/site/docs-v*' 'docs/site/docs-fr-v*')

if [ -n "$edited" ]; then
echo "These pages belong to a frozen version and must not be changed or removed:"
echo "$edited" | sed 's/^/ /'
Expand Down
Loading