Skip to content

ci: make bump preview comment sticky - #2008

Merged
Lee-W merged 1 commit into
masterfrom
fix/bump-preview-sticky-comment
Jun 21, 2026
Merged

ci: make bump preview comment sticky#2008
Lee-W merged 1 commit into
masterfrom
fix/bump-preview-sticky-comment

Conversation

@bearomorphism

@bearomorphismbearomorphism commented May 30, 2026

Copy link
Copy Markdown
Collaborator

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-includes to peter-evans/create-or-update-comment@v5, but that action has no such input (see its action.yml). It only creates new comments, or updates one identified by comment-id.

Fix: insert a peter-evans/find-comment@v3 step ahead of the post step, then pass its comment-id output (empty on first run) to create-or-update-comment. Matches the documented pattern in the action's README. The same fix is applied to the tutorial example in docs/tutorials/github_actions.md (also bumped @v4 -> @v5 to match the workflow).

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Generated-by: GitHub Copilot CLI following the guidelines

Code Changes

  • Add test cases to all the changes you introduce
    • N/A -- GitHub Actions workflows have no in-repo test harness; end-to-end verification happens on the next PR sync after merge.
  • Run uv run poe all locally to ensure this change passes linter check and tests
    • Targeted: prek run --files <changed> -- all hooks pass. No Python sources touched.
  • Manually test the changes
  • Update the documentation for the changes

Documentation Changes

  • Run uv run poe doc locally to ensure the documentation pages renders correctly
    • Verified with uv run mkdocs build --strict -- exits 0, no warnings.
  • Check and fix any broken links (internal or external)

Expected Behavior

After merge, each PR has at most one Commitizen bump preview comment from github-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:

  1. Push a follow-up commit to any open same-repo PR (e.g. docs(contributing): add agent-facing playbooks and architecture overview #2007) to trigger the workflow.
  2. Confirm only one preview comment exists, with its body refreshed to the latest run.
  3. Open a brand-new same-repo PR and confirm a single preview comment is created on the first run.

Additional Context

Related: #1957 (workflow originally added).

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>
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Commitizen bump preview

Merging this PR will produce the following bump:

bump: version 4.16.2 → 4.16.3
tag to create: v4.16.3
increment detected: PATCH

@codecov

codecovBot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.24%. Comparing base (2b4707c) to head (7317183).
⚠️ Report is 6 commits behind head on master.
✅ All tests successful. No failed tests found.

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 Harness.
📢 Have feedback on the report? Share it here.

@bearomorphismbearomorphism changed the title fix(ci): make bump preview comment stickyci: make bump preview comment stickyMay 30, 2026

CopilotAI 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.

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@v3 step to locate the prior preview comment by marker/author and feed its comment-id into peter-evans/create-or-update-comment@v5.
  • Remove the unsupported body-includes input from create-or-update-comment usage in the workflow.
  • Update the tutorial example and explanatory text to reflect the new “find then update” approach and the @v5 action version.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

FileDescription
docs/tutorials/github_actions.mdUpdates the documented workflow snippet and explanation to use find-comment + comment-id with create-or-update-comment@v5.
.github/workflows/pr-bump-preview.ymlMakes 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.

@Lee-W
Lee-W merged commit 5ef5483 into masterJun 21, 2026
22 checks passed
@Lee-W
Lee-W deleted the fix/bump-preview-sticky-comment branch June 21, 2026 13:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@bearomorphism@Lee-W