fix(ci): verify comment author before updating/deleting impact comment - #2496
Merged
Merged
Conversation
codegraph-impact-comment.yml's sticky-comment lookup selected an existing comment to update purely by body.startsWith(marker), with no check that the comment was actually posted by the workflow's own bot account — the same gap Greptile flagged (Confidence 3/5) on PR #2351 for closing-keyword-check.yml's identical pattern. Any PR participant posting a comment starting with the same marker text would have it silently overwritten the next time this workflow runs for that PR. Adds the same c.user.login === 'github-actions[bot]' check #2351's fix already applies to closing-keyword-check.yml. Closes #2352
Contributor
Greptile SummaryThis PR prevents participant-authored comments from being mistaken for the workflow’s sticky impact comment.
Confidence Score: 5/5The PR appears safe to merge with no actionable issues identified. The workflow’s automatic GitHub token creates comments as Important Files Changed
Reviews (1): Last reviewed commit: "fix(ci): verify comment author before up..." | Re-trigger Greptile |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
closing-keyword-check.yml's sticky-comment lookup selected an existing comment purely bybody.includes(marker), with no check that the comment was authored by the workflow's own bot account — a PR participant could plant the marker text in their own comment and have it silently overwritten/deleted by a later run.codegraph-impact-comment.ymlhas the exact same pattern, pre-dating fix(ci): add non-blocking reminder for non-closing issue references in PRs #2351:comments.find(c => c.body.startsWith('## Codegraph Impact Analysis')).c.user.login === 'github-actions[bot]'check fix(ci): add non-blocking reminder for non-closing issue references in PRs #2351's fix already applies toclosing-keyword-check.yml.Test plan
.github/workflows/*.ymlchange, not application code)grepacross.github/workflows/)Closes #2352