-
-
Notifications
You must be signed in to change notification settings - Fork 239
ci: Add CI enforcement to prevent manual CHANGELOG.md edits #3075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: auto-changelog
Are you sure you want to change the base?
ci: Add CI enforcement to prevent manual CHANGELOG.md edits #3075
Conversation
Add a new workflow that checks PRs for CHANGELOG.md modifications and fails unless the PR title starts with `meta(changelog):`. When a violation is detected, posts a comment explaining the automated changelog policy and what action to take. Fixes #3072 Co-Authored-By: Claude <noreply@anthropic.com>
| repo: context.repo.repo, | ||
| pull_number: prNumber, | ||
| per_page: 100 | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing pagination allows CHANGELOG.md bypass in large PRs
Medium Severity
The listFiles call only fetches the first 100 files without handling pagination. If a PR modifies more than 100 files and CHANGELOG.md is not in the first page of results, the enforcement check will fail to detect it and allow the PR to merge without proper validation. This silently bypasses the intended changelog protection mechanism.
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: prNumber | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing pagination may cause duplicate warning comments
Low Severity
The listComments call doesn't specify per_page, using the default of 30. If a PR has more than 30 comments, the existing bot comment may not be found when checking for duplicates, causing repeated warning comments to be posted on subsequent workflow runs.
Use github.paginate() for both listFiles and listComments API calls to handle PRs with >100 changed files or >30 comments. Without pagination, CHANGELOG.md changes could go undetected in very large PRs, and duplicate warning comments could be posted on PRs with many existing comments. Co-Authored-By: Claude <noreply@anthropic.com>
Add an HTML marker to identify the bot comment, and delete it when the PR no longer violates the changelog policy (either by updating the title to meta(changelog): or removing CHANGELOG.md changes). This prevents stale warning comments from persisting after fixes. Co-Authored-By: Claude <noreply@anthropic.com>
Description
Add a new CI workflow that prevents manual CHANGELOG.md modifications unless the PR title starts with
meta(changelog):.This is a follow-up to #3074 which removed DangerJS. Now that changelogs are auto-generated, we need to prevent accidental manual edits. When a violation is detected, the workflow posts a comment explaining the policy and fails the check.
The workflow:
meta(changelog):Issues
CHANGELOG.mdchanges #3072