Sticky Comments
Give almost every PR comment a sticky-id. Dev Herald then updates that same comment on later runs, and can remove it when a successful run has nothing left to report.
Use a sticky-id unless you truly want a new comment on every run. It is the handle Dev Herald uses to find the comment again: to update it, and to delete it once the result is stale. A comment posted without one cannot be removed later.
The problem
Without a sticky-id, each CI run creates a new comment, flooding your PR:
# ❌ Creates duplicate comments
- name: Post Deployment Status
uses: dev-herald/comment@v1
with:
api-key: ${{ secrets.DEV_HERALD_API_KEY }}
pr-number: ${{ github.event.pull_request.number }}
template: DEPLOYMENT
template-data: |
{ ... }The solution
Add sticky-id to update the same comment every time:
# ✅ Updates in place
- name: Post Deployment Status
uses: dev-herald/comment@v1
with:
api-key: ${{ secrets.DEV_HERALD_API_KEY }}
pr-number: ${{ github.event.pull_request.number }}
template: DEPLOYMENT
sticky-id: deployment-status # 👈 Add this
template-data: |
{ ... }Multiple sticky comments
Use different IDs for different signals:
sticky-id: deployment-status # For deployments
sticky-id: bundle-size # For bundle analysis
sticky-id: test-results # For test resultsEach updates and deletes independently. Use descriptive, consistent IDs across your workflows.
Keep the id stable. dependency-diff on one workflow and deps on the next are two different comments, and a later delete only removes the id you send.
To put several signals in one comment, pass a signals list and one sticky-id. See Combined Signals.
Works everywhere
Sticky comments work with signals, templates, and custom markdown:
# With templates
template: DEPLOYMENT
sticky-id: deployment-status
# With signals
signal: TEST_RESULTS
sticky-id: test-results
# With markdown
comment: "## Status: ✅"
sticky-id: build-statusRemoving a stale comment
When a later run succeeds and has nothing left to report, delete the sticky comment. Leaving it up, or rewriting it as “no changes”, asks reviewers to interpret a result that no longer matters.
| Current result | Sticky comment already on the PR | What to do |
|---|---|---|
| Something to report | Yes | Update it |
| Something to report | No | Create it |
| Nothing to report | Yes | Delete it |
| Nothing to report | No | Do nothing |
For a combined comment, drop the sections that no longer apply and update the rest. Delete the comment only when no sections remain.
Delete only after the check succeeds and the report is empty. A failed check or a missing report should leave the previous comment in place. Sending an empty comment body does not delete anything.
Send DELETE /api/v1/github/comment with the same pull request number and sticky id:
{
"prNumber": 123,
"stickyId": "dependency-diff"
}stickyId is required. The same project API key used to post the comment authorizes the delete.
The comment disappears from the pull request. Notifications that were already sent stay sent. If that sticky comment is already gone, or it never reached GitHub, the request still succeeds and the pull request is left unchanged.
How Dev Herald tracks comments
Dev Herald stores a small amount of metadata (PR number, sticky ID, comment ID) to find and update the right comment on subsequent runs. No source code is stored. See Data & Privacy for details.