Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Add CHANGELOG.md modification check and warning comment - #4217

Open
mario-campos wants to merge 48 commits into
mainfrom
mario-campos/warn-on-changelog-write
Open

mario-campos wants to merge 48 commits into
mainfrom
mario-campos/warn-on-changelog-write

Conversation

@mario-campos

@mario-campos mario-campos commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds a PR check for non-release/mergeback/update-bundle PRs. The check posts a sticky PR comment if CHANGELOG.md has been modified in the PR, warning the author to instead direct their change to a change-note.

Testing

In order to test this Action and its script, I forked this repository at dsp-testing/mario-campos-post-comment-test and modified the CHANGELOG.md file in a PR.

In dsp-testing#2, a comment was successfully created.

In dsp-testing#3, I modified CHANGELOG.md to invoke the comment, and then subsequently reverted the change to successfully invoke the comment deletion.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Workflow types:

  • N/A

Products:

  • N/A

Environments:

  • Test repository - This change will be tested on a test repository before merging.
  • Testing/None - This change does not impact any CodeQL workflows in production.

How did/will you validate this change?

  • None - I am not validating these changes.

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Development/testing only - This change cannot cause any failures in production.

How will you know if something goes wrong after this change is released?

  • N/A

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

@github-actions github-actions Bot added the size/XS Should be very easy to review label Oct 8, 2026

@mbg mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread .github/workflows/pr-checks.yml Resolved
Comment thread .github/workflows/pr-checks.yml Resolved
@github-actions github-actions Bot added size/S Should be easy to review and removed size/XS Should be very easy to review labels Oct 8, 2026
@mario-campos
mario-campos marked this pull request as ready for review October 8, 2026 17:43
@mario-campos
mario-campos requested a review from a team as a code owner October 8, 2026 17:43
Copilot AI balanced review requested due to automatic review settings October 8, 2026 17:43

Copilot AI left a comment

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.

🟡 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.md modifications.
  • 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.

Comment thread .github/workflows/pr-checks.yml Resolved
Comment thread .github/workflows/pr-checks.yml Resolved
Comment thread .github/workflows/pr-checks.yml Resolved
mario-campos and others added 2 commits October 8, 2026 12:55
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>
@mario-campos

Copy link
Copy Markdown
Contributor Author

@copilot Are there unresolved findings?

Copilot AI commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@copilot Are there unresolved findings?

Yes—one valid finding remains: the warning step is gated on changelog-changed == 'true', so if a later commit reverts the CHANGELOG.md change, the step never runs and the existing warning comment stays stale. It should also run when the file is unchanged and remove any existing marker comment. The shell backticks are escaped, and the automation exclusion checks now include branch criteria.

Copilot AI left a comment

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.

🟢 Approval recommended

The workflow correctly handles comment creation, deduplication, cleanup, and automation exemptions.

0 open findings

3 resolved since last review

🧠 Review effort: Balanced

@mbg mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread .github/workflows/pr-checks.yml Resolved
Comment thread .github/workflows/pr-checks.yml Resolved
Comment thread .github/workflows/pr-checks.yml Resolved
mario-campos and others added 2 commits October 28, 2026 16:08
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mario-campos
mario-campos requested a review from mbg October 28, 2026 21:49

@mbg mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for taking the time to simplify the script! That's appreciated!

During my review, I went through the changes in the order of:

  • The new version of the script
  • The reusable action
  • The workflow changes

Aside from some minor comments, I was happy with the script and the reusable action which looked good to approve with just the minor suggestions 👍🏻

Then I looked over the workflow changes. There are a couple of points with the checkout/Node setup that probably should be addressed before we merge this. The most critical point is in my last comment about the changelog comment probably getting posted if there's no change to the file to begin with, which is what prompted me to pick "Request changes" here. Partially my bad for suggesting that we simplify the script this much, but hopefully not a huge deal to add that little bit of functionality back in.

Comment thread pr-checks/post-comment.ts Resolved
Comment thread pr-checks/post-comment.ts Resolved
Comment thread pr-checks/post-comment.ts Resolved
Comment thread pr-checks/post-comment.ts Resolved
Comment thread pr-checks/post-comment.ts Resolved
Comment thread .github/actions/post-comment/action.yml Resolved
Comment thread .github/workflows/pr-checks.yml Resolved
Comment thread .github/workflows/pr-checks.yml Resolved
Comment thread .github/workflows/pr-checks.yml Resolved
Comment thread .github/workflows/pr-checks.yml Resolved
@github-actions github-actions Bot added size/XL May be very hard to review and removed size/L May be hard to review labels Oct 29, 2026
Comment thread pr-checks/post-comment.ts Fixed
mario-campos and others added 6 commits October 29, 2026 11:32
Use a boolean --create-if-missing flag, supplied by the composite action by default and omitted for resolution updates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ing concatenation'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Comment thread pr-checks/post-comment.ts Resolved
Comment thread pr-checks/post-comment.ts
The `.github/actions/post-comment` action requires callers to supply this value via its
`marker` input.
Creates or updates a pull request comment identified by a marker. The marker
is supplied via `--marker` (or the `.github/actions/post-comment` action's `marker` input)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

or the .github/actions/post-comment action's marker input

Minor: But that just passes a value to --marker?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes

Comment thread pr-checks/post-comment.ts Resolved
Comment thread pr-checks/post-comment.ts Resolved
Comment thread .github/actions/post-comment/action.yml Resolved
Comment thread .github/actions/post-comment/action.yml Resolved
Comment thread .github/actions/post-comment/action.yml Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL May be very hard to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants