Skip to content

follow-up: codegraph-impact-comment.yml comment lookup doesn't verify author, same pattern Greptile flagged on #2351 #2352

Closed

Description

@carlos-alm

Problem

Greptile flagged (Confidence 3/5, on PR #2351) that closing-keyword-check.yml's sticky-comment lookup selected an existing comment to update/delete purely by body.includes(marker), with no check that the comment was actually authored by the workflow's own bot account. A PR participant could plant the marker text in their own comment, and a later workflow run would overwrite or delete that participant-authored content.

.github/workflows/codegraph-impact-comment.yml has the exact same pattern, pre-dating #2351:

const existing = comments.find(c => c.body.startsWith('## Codegraph Impact Analysis'));

Any PR participant who posts a comment starting with ## Codegraph Impact Analysis would have it silently overwritten or deleted the next time this workflow runs for that PR.

Fix direction

Add the same author check used in #2351's fix: restrict the match to c.user.login === 'github-actions[bot]' (or equivalent bot-identity check) in addition to the existing body-prefix match, in .github/workflows/codegraph-impact-comment.yml.

Filed per this repo's scope-discipline convention rather than fixed inline in #2351, since that PR's own diff doesn't touch this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions