diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index c85ec00..243289c 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -14,11 +14,20 @@ on: # serializing would only delay responses and cancelling would drop them. jobs: claude: + # SECURITY: gated to github.actor == 'jnasbyupgrade' so only that account + # can invoke Claude via @claude mentions. Without this, any GitHub user + # (or bot) commenting/opening an issue containing "@claude" would cause + # this job to run using the org's Claude Code OAuth token and a + # repo-scoped GITHUB_TOKEN. To add more trusted accounts, extend the + # actor check. if: | - (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || - (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || - (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || - (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + github.actor == 'jnasbyupgrade' && + ( + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + ) runs-on: ubuntu-latest timeout-minutes: 30 permissions: