Repository navigation
Add CHANGELOG.md modification check and warning comment - #4217
mario-campos wants to merge 13 commits into
Conversation
mbg
left a comment
There was a problem hiding this comment.
Couple of initial comments on this draft. I like that this is taking advantage of the setup that the existing fetch-base provides.
I haven't checked if the changelog-check step behaves as expected yet either. One thing I did note though related to it is that the fetch-base step is skipped if github.event.pull_request.user.login != 'dependabot[bot]'. That isn't new in this PR (and we probably shouldn't address it here), but it might be better to check github.triggering_actor instead of github.event.pull_request.user.login. The justification in the comment is that Dependabot doesn't have permission, but it is possible for us to push commits to Dependabot PR branches or re-run workflows on it.
Also agree that it would be good to not spam the comment and instead replace an existing one. It's fairly easy to do that with gh or in a script by leaving a comment (<!-- some distinct marker -->) in the comment that's posted and then looking for that.
There was a problem hiding this comment.
🟡 Changes recommended
Shell command substitution currently prevents warning creation, and comment lifecycle and exclusion logic need correction.
3 open findings
What changed in this PR
Adds a PR check that warns contributors to use change notes instead of editing CHANGELOG.md directly.
Changes:
- Detects
CHANGELOG.mdmodifications. - Adds a sticky warning comment with automation exclusions.
- Consolidates PR comment posting into one job.
| File | Description |
|---|---|
.github/workflows/pr-checks.yml |
Detects changelog edits and posts PR warnings. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Refactor conditions for PR title checks in workflow. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot Are there unresolved findings? |
Yes—one valid finding remains: the warning step is gated on |
mbg
left a comment
There was a problem hiding this comment.
Thanks for changing this to move away from pulling in another action and also moving the step that posts or updates the comment out of other-checks and into (now) post-pr-comments.
I added a few more comments, but the main one is about avoiding more, lengthy-ish shell scripts. It shouldn't be hard to implement in TS in pr-checks and I have included some relevant pointers in my detailed comment about this.
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| CHANGED: ${{ needs.other-checks.outputs.changelog-changed }} | ||
| run: | |
There was a problem hiding this comment.
I am not keen on adding more shell scripts in workflow steps beyond very short ones, and this one is now a bit long with the $CHANGED check added as well.
Can you turn this into a new script in pr-checks instead? We already have a couple of helpers in api-client.ts there. See sync-checks.ts or update-release-branch.ts for examples of scripts that use the API there.
The script doesn't even have to be all that specific to this. The "create-or-update-comment" pattern is probably useful in a few different places.
Co-authored-by: Michael B. Gale <mbg@github.com>

This PR adds a PR check for non-release/mergeback/update-bundle PRs. The check posts a sticky PR comment if
CHANGELOG.mdhas been modified in the PR, warning the author to instead direct their change to a change-note.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
Products:
Environments:
How did/will you validate this change?
If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist