ci: make bump preview comment sticky#2008
Conversation
The PR bump preview workflow passed �ody-includes to peter-evans/create-or-update-comment@v5, but that action has no such input -- it only creates a new comment, or updates one passed via comment-id. Every run therefore appended another duplicate comment (e.g. 6 stacked on #2007). Insert a peter-evans/find-comment@v3 step ahead of the post step to look up an existing preview comment by sentinel marker and bot author, then pass its id (empty for the first run) to create-or-update-comment. This matches the documented pattern in the action's README and keeps the bump preview as a single sticky comment per PR. Apply the same fix to the docs/tutorials/github_actions.md example so other projects copying the workflow don't inherit the bug, and also bump the example from create-or-update-comment@v4 to @v5 to match the workflow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Commitizen bump previewMerging this PR will produce the following bump: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2008 +/- ##
=======================================
Coverage 98.24% 98.24%
=======================================
Files 61 61
Lines 2785 2785
=======================================
Hits 2736 2736
Misses 49 49 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
Updates the PR bump preview workflow to update a single existing “Commitizen bump preview” comment instead of posting a new one on every run, aligning the workflow and the tutorial documentation with the supported peter-evans/create-or-update-comment usage pattern.
Changes:
- Add a
peter-evans/find-comment@v3step to locate the prior preview comment by marker/author and feed itscomment-idintopeter-evans/create-or-update-comment@v5. - Remove the unsupported
body-includesinput fromcreate-or-update-commentusage in the workflow. - Update the tutorial example and explanatory text to reflect the new “find then update” approach and the
@v5action version.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
docs/tutorials/github_actions.md |
Updates the documented workflow snippet and explanation to use find-comment + comment-id with create-or-update-comment@v5. |
.github/workflows/pr-bump-preview.yml |
Makes the bump preview comment “sticky” by finding an existing comment and updating it in place via comment-id. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
The PR bump preview workflow appends a new comment on every run instead of editing the previous one -- see #2007, which has 6 duplicate comments.
Cause: it passes
body-includestopeter-evans/create-or-update-comment@v5, but that action has no such input (see itsaction.yml). It only creates new comments, or updates one identified bycomment-id.Fix: insert a
peter-evans/find-comment@v3step ahead of the post step, then pass itscomment-idoutput (empty on first run) tocreate-or-update-comment. Matches the documented pattern in the action's README. The same fix is applied to the tutorial example indocs/tutorials/github_actions.md(also bumped@v4->@v5to match the workflow).Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot CLI following the guidelines
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsprek run --files <changed>-- all hooks pass. No Python sources touched.Documentation Changes
uv run poe doclocally to ensure the documentation pages renders correctlyuv run mkdocs build --strict-- exits 0, no warnings.Expected Behavior
After merge, each PR has at most one
Commitizen bump previewcomment fromgithub-actions[bot], updated in place on subsequent runs. Pre-existing duplicate comments are not pruned by this PR.Steps to Test This Pull Request
After merge:
Additional Context
Related: #1957 (workflow originally added).