fix: delete stale sticky comment when local tests pass on re-run#44
Merged
Conversation
When ci-verify-local transitions from failure → success, the "## Local tests" sticky comment posted by the failure run was never cleaned up. Add a success-path step that looks for an existing comment (by the same startsWith predicate used by the failure path) and DELETEs it via the GitHub API. No new permissions needed — pull-requests: write was already present. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ci-verify-localtransitions from failure → success on a re-run, the "## Local tests" sticky comment posted by the failure run was never cleaned up — it stayed on the PR indefinitely.Clean up stale sticky comment on successstep that runs only on the success path, queries for any existing comment starting with"## Local tests", and deletes it viaDELETE /repos/{owner}/{repo}/issues/comments/{id}.pull-requests: writewas already declared for the failure path'sPOST/PATCH.What changed
.github/workflows/ci-verify-local.yml— added a step between "Pass if evidence found" and "Post sticky comment if missing or failed":The
startsWith("## Local tests")predicate matches both the "not yet uploaded" and "failed" comment variants — the same predicate used by the failure path's update logic.Reviewer notes
head -1guards against the edge case where two matching comments exist (e.g. from concurrent runs).${{ }}interpolations go throughenv:variables — consistent with the existing security posture documented at the top of the file.if [ -n "$existing" ]guard).Test plan
🤖 Generated with Claude Code