PMM-7 Add Claude Code GitHub Actions workflow#5633
Open
ademidoff wants to merge 1 commit into
Open
Conversation
Adds a tag workflow that lets trusted collaborators trigger Claude by mentioning @claude in a PR or issue comment (e.g. to request a review). - Triggers on issue_comment and pull_request_review_comment. - Gated to OWNER/MEMBER/COLLABORATOR author association so external fork contributors on this public repo cannot invoke it. - Authenticates via the ANTHROPIC_API_KEY repo/org secret. - Actions are SHA-pinned to match repo conventions. Requires the Claude GitHub App to be installed on the repo and an ANTHROPIC_API_KEY secret to be configured.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5633 +/- ##
==========================================
+ Coverage 43.59% 43.81% +0.22%
==========================================
Files 415 415
Lines 43134 42893 -241
==========================================
- Hits 18804 18795 -9
+ Misses 22454 22225 -229
+ Partials 1876 1873 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions workflow to enable invoking Claude Code via @claude mentions on PR/issue comments, with gating to trusted collaborator associations to control secret/API usage in a public repository.
Changes:
- Introduces
.github/workflows/claude.ymltriggered byissue_commentandpull_request_review_commentcreation events. - Adds an
if:guard requiring@claudein the comment body andOWNER|MEMBER|COLLABORATORauthor association. - Runs the
anthropics/claude-code-actionwithANTHROPIC_API_KEYand elevated job permissions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+35
to
+39
| - name: Checkout repository | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
Comment on lines
+24
to
+25
| runs-on: ubuntu-latest | ||
|
|
Comment on lines
+9
to
+12
|
|
||
| permissions: | ||
| contents: read | ||
|
|
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.
What
Adds
.github/workflows/claude.yml— a tag workflow that lets trusted collaborators trigger Claude by mentioning@claudein a PR or issue comment (e.g.@claude review this PR).How it works
issue_commentandpull_request_review_comment(created).@claudeand the author's association isOWNER,MEMBER, orCOLLABORATOR. This prevents external fork contributors on this public repo from invoking Claude and spending our API budget.ANTHROPIC_API_KEYsecret.Prerequisites (must be done by a repo/org admin before this works)
percona/pmm(https://github.com/apps/claude), granting Contents / Pull requests / Issues read-write.ANTHROPIC_API_KEYsecret (repo orperconaorg level, scoped to this repo).Once both are in place, commenting
@claude ...on any PR will trigger the workflow. A separate automatic-review workflow (onpull_request) can be added later if desired.