@@ -205,12 +205,20 @@ jobs:
205205 ;;
206206 esac
207207 } > comment.md
208- - uses : peter-evans/create-or-update-comment@v4
208+ - name : Find existing preview comment
209+ id : find-comment
210+ uses : peter-evans/find-comment@v3
209211 with :
210212 token : ${{ secrets.GITHUB_TOKEN }}
211213 issue-number : ${{ github.event.pull_request.number }}
212- body-path : comment.md
214+ comment-author : " github-actions[bot] "
213215 body-includes : " <!-- commitizen-bump-preview -->"
216+ - uses : peter-evans/create-or-update-comment@v5
217+ with :
218+ token : ${{ secrets.GITHUB_TOKEN }}
219+ comment-id : ${{ steps.find-comment.outputs.comment-id }}
220+ issue-number : ${{ github.event.pull_request.number }}
221+ body-path : comment.md
214222 edit-mode : replace
215223` ` `
216224
@@ -235,10 +243,13 @@ jobs:
235243 ` update_changelog_on_bump` is set in your config, also the changelog
236244 entries that would be produced). Exit code `21` (`NoneIncrementExit`)
237245 is treated as "no eligible bump" rather than a failure.
238- - **Sticky comment**: The hidden HTML marker `<!-- commitizen-bump-preview -->`
239- lets [`peter-evans/create-or-update-comment`](https://github.com/peter-evans/create-or-update-comment)
240- find and replace the previous preview on every push, instead of leaving a
241- growing trail of comments.
246+ - **Sticky comment**: [`peter-evans/find-comment`](https://github.com/peter-evans/find-comment)
247+ looks up an existing comment by the hidden HTML marker
248+ ` <!-- commitizen-bump-preview -->` and bot author, then
249+ [`peter-evans/create-or-update-comment`](https://github.com/peter-evans/create-or-update-comment)
250+ edits it in place (or creates a new one on the first run when the
251+ marker is not yet present), instead of leaving a growing trail of
252+ comments.
242253
243254[jinja] : https://github.com/commitizen-tools/commitizen/blob/master/commitizen/changelog.py
244255
0 commit comments