Repository navigation
Warn about direct CHANGELOG.md changes in PR checks - #4294
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The workspace-only install omits required root dependencies, leaving warning and resolution comment scripts at risk of module-loading failures in CI.
1 open issue
What changed in this PR
Activates warnings for direct CHANGELOG.md edits in repository PR checks, using the comment action supplied by prerequisite #4217. Production CodeQL workflows are unaffected.
Changes:
- Detects changelog modifications and exposes the result as a job output.
- Extends the commenting job with trusted
maincheckout and Node/dependency setup. - Adds sticky warning and update-only resolution comments, excluding release, backport, mergeback, and bundle-update branches.
| File | Description |
|---|---|
.github/workflows/pr-checks.yml |
Wires changelog detection and warning/resolution comments into PR checks while preserving repo-size commenting. |
Review effort: Balanced (auto)
Split workflow activation from #4217 while keeping the comment action loaded from trusted main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
5c6d084 to
9e531e1
Compare
navntoft
left a comment
There was a problem hiding this comment.
LGTM. The workflow changes seem to follow the conventions used in other workflows.
There was a problem hiding this comment.
🟡 Changes recommended
The workflow exposes a write-permission job to PR-scope cache poisoning and unintentionally makes the renamed optional commenting job a required check, potentially blocking merges.
6 open issues
Update the excluded check name alongside the workflow rename · New Disable npm caching in the trusted comment job · New Support changelog warnings for fork-based PRs · New Run changelog detection independently of validation failures · New Narrow the release-branch exemption to avoid skipping ordinary PRs · New Match existing comments only when authored by the bot · New
1 resolved since last review
Review effort: Max
| post-repo-size-comment: | ||
| name: Post repo size comment | ||
| post-pr-comments: | ||
| name: Post PR comments |
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | ||
| with: | ||
| node-version: 24 | ||
| cache: "npm" |
|
|
||
| - name: Check for CHANGELOG.md changes | ||
| id: changelog-check | ||
| if: steps.fetch-base.outcome == 'success' |
|
|
||
| - name: Check for CHANGELOG.md changes | ||
| id: changelog-check | ||
| if: steps.fetch-base.outcome == 'success' |
| !startsWith(github.event.pull_request.head.ref, 'update-v') && | ||
| !startsWith(github.event.pull_request.head.ref, 'backport-v') && | ||
| !startsWith(github.event.pull_request.head.ref, 'mergeback/') && | ||
| !startsWith(github.event.pull_request.head.ref, 'update-bundle/') | ||
| uses: ./.github/actions/post-comment | ||
| with: | ||
| marker: "post-comment:CHANGELOG.md" | ||
| body: | | ||
| ⚠️ `CHANGELOG.md` has been modified in this PR. Please do not modify `CHANGELOG.md` directly. | ||
| Instead, create a change-note file in `unreleased-change-notes/`. The `CHANGELOG.md` | ||
| file will be automatically generated from those change-notes. | ||
| See [`unreleased-change-notes/README.md`](https://github.com/github/codeql-action/blob/main/unreleased-change-notes/README.md) for more information. | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Mark the CHANGELOG.md concern as resolved | ||
| if: >- | ||
| needs.other-checks.outputs.changelog-modified == 'false' && | ||
| !startsWith(github.event.pull_request.head.ref, 'update-v') && |
| !startsWith(github.event.pull_request.head.ref, 'update-bundle/') | ||
| uses: ./.github/actions/post-comment | ||
| with: | ||
| marker: "post-comment:CHANGELOG.md" |


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.This PR is split-off from #4217, which retains the prerequisite
post-commentAction.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types: None of the production workflow types; only this repository's PR checks.
Products: No production analysis behavior changes.
Environments:
How did/will you validate this change?
post-commentAction #4217 merges and this PR is updated.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?
post-commentAction #4217 being inmain, Addpost-commentAction #4217 must merge first. CI is expected to fail until then. After Addpost-commentAction #4217 is merged, then this PR will be rebased.Merge / deployment checklist
post-commentAction #4217 on main first.