ci: exclude deleted files from changelog-location check#2
Merged
Conversation
The check-changelog job in deploy.yml flagged any path matching ^CHANGELOG-.*\.md$ in the diff — including pure deletions. Commits that moved a root-level changelog into changelogs/ or removed duplicates still failed the gate, since the old root path appeared in git diff --name-only as a deletion entry. Fix: pass --diff-filter=ACMR so the file list only contains files that were Added, Copied, Modified, or Renamed — deletions are ignored. Newly-added root-level CHANGELOG-*.md files are still caught.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
check-changelogjob in.github/workflows/deploy.ymlwas failing on every commit that removed a root-levelCHANGELOG-*.mdfile — including legitimate cleanup commits that moved stray root changelogs intochangelogs/(the very fix the rule is meant to encourage).Root cause:
git diff --name-onlyreturns a path regardless of whether the file was added, modified, or deleted. The regex^CHANGELOG-.*\.md$matched deleted root-level changelogs and the job exited 1.This was hit on PR #1 (which merged anyway) and is currently breaking CI on
mainfor the merge commit.Fix
Pass
--diff-filter=ACMRto bothgit diff --name-onlyinvocations so the file list only includes Added / Copied / Modified / Renamed entries. Pure deletions are excluded.Newly-added root-level
CHANGELOG-*.mdfiles are still caught — that's still in the ACMR set.Test plan
Deploy to GitHub Pagesworkflow →check-changelogshould pass (only.github/workflows/deploy.ymlandchangelogs/CHANGELOG-ci-changelog-check.mdchange; no root-level changelog deletions remain in the ACMR-filtered diff)mainthat touches code should passcheck-changelog🤖 Generated with Claude Code