Repository navigation
Add CHANGELOG.md modification check and warning comment #4217
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
Open
mario-campos
wants to merge
19
commits into
main
Choose a base branch
from
mario-campos/warn-on-changelog-write
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+670
−2
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b2b77a8
Add CHANGELOG.md modification check and warning comment
mario-campos fbd33ac
Gate comment-post step on successful fetch-base
mario-campos 43ac64c
Use `gh api` instead of third-party Action
mario-campos f7aa9dc
Move post-comment step to `post-pr-comments` job
mario-campos 780e947
Skip CHANGELOG.md modification warning for release and backport PRs
mario-campos ae75d46
Exclude "Mergeback" and "Update default bundle" PRs from CHANGELOG.md…
mario-campos 6e4d3fb
Use a sticky comment to warn about CHANGELOG.md changes
mario-campos d97a656
Update CHANGELOG.md warning message to reference change-notes directory
mario-campos ccdf690
Escape backticks PR comment body
mario-campos 928548a
Refine exclusion conditions for CHANGELOG-modification comment
mario-campos 0707124
Delete CHANGELOG.md-modification comment if CHANGELOG.md no longer mo…
mario-campos 27d37d9
Format all file references as inline Markdown code spans
mario-campos 9fe741e
Simplify `if` condition of CHANGELOG-comment-post step
mario-campos 8c8b082
Add script and Action for managing PR comments
mario-campos 14cefaa
Replace bash/run step with local Action `post-comment`
mario-campos 4d464b0
Improve issue ID parsing and validation logic
mario-campos 3c452a1
Use HTTP link to `unreleased-change-notes/README.md`
mario-campos f1419b8
Reject empty `--marker`
mario-campos e7dadca
Refactor comment handling logic into `performAction` for improved tes…
mario-campos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: "Post comment" | ||
| description: "Create, update, or delete a sticky PR comment identified by an automatically-derived HTML-comment marker. If this action is used more than once within the same job, give each step an explicit 'id:' so the derived marker stays unique." | ||
| inputs: | ||
| body: | ||
| description: "Full comment markdown." | ||
| required: true | ||
| action-condition: | ||
| description: "The business condition ('true' or 'false') that selects which action to perform." | ||
| required: true | ||
| action-if-true: | ||
| description: "Action to perform when action-condition is 'true'. One of: none, insert, upsert, delete." | ||
| required: true | ||
| action-if-false: | ||
| description: "Action to perform when action-condition is 'false'. One of: none, insert, upsert, delete." | ||
| required: true | ||
| issue-id: | ||
| description: "The issue or pull request number to post/update/delete the comment on. Defaults to the current pull request if not provided." | ||
| required: false | ||
| token: | ||
| description: "The GitHub token to authenticate with." | ||
| required: true | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Post comment | ||
| shell: bash | ||
| env: | ||
| BODY: ${{ inputs.body }} | ||
| # Derived from the workflow name, job id, and step id/sequence-number so that repeated | ||
| # runs of the same step find the same comment (for upsert/delete), while distinct steps | ||
| # (even within the same job) get distinct markers. | ||
| MARKER: <!-- post-comment:${{ github.workflow }}:${{ github.job }}:${{ github.action }} --> | ||
| GH_TOKEN: ${{ inputs.token }} | ||
| ISSUE_ID: ${{ inputs.issue-id || github.event.pull_request.number }} | ||
| ACTION_CONDITION: ${{ inputs.action-condition }} | ||
| ACTION_IF_TRUE: ${{ inputs.action-if-true }} | ||
| ACTION_IF_FALSE: ${{ inputs.action-if-false }} | ||
| run: | | ||
| npx tsx ./pr-checks/post-comment.ts \ | ||
| --body "$BODY" \ | ||
| --marker "$MARKER" \ | ||
| --action-condition "$ACTION_CONDITION" \ | ||
| --action-if-true "$ACTION_IF_TRUE" \ | ||
| --action-if-false "$ACTION_IF_FALSE" \ | ||
| --issue-id "$ISSUE_ID" \ | ||
| --repository "$GITHUB_REPOSITORY" |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.