Open
Conversation
Mirrors the production setup in stellar/stellar-dbt#833. Lets repo OWNERs and COLLABORATORs invoke Claude on PRs and issues by @claude-tagging a comment, review, or issue body. Authenticates to Anthropic via GitHub OIDC + Workload Identity Federation — no long-lived API key in repo secrets. Public-repo variant: gate excludes MEMBER, only OWNER and explicitly-invited COLLABORATORs can invoke.
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions workflow to enable invoking Anthropic Claude Code in this repo via @claude mentions, using GitHub OIDC + Workload Identity Federation (WIF) instead of long-lived API keys.
Changes:
- Introduces
claude.ymlworkflow triggered from PR/issue comments, PR reviews, issues, and manual dispatch. - Adds a job-level authorization gate intended to restrict invocation to
OWNER/COLLABORATOR. - Implements an OIDC-to-Anthropic OAuth token exchange step and then runs
anthropics/claude-code-action.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+18
| if: | | ||
| github.event_name == 'workflow_dispatch' || | ||
| (github.event_name == 'issue_comment' && |
Comment on lines
+30
to
+33
| (github.event_name == 'issues' && | ||
| (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) && | ||
| (github.event.issue.author_association == 'OWNER' || | ||
| github.event.issue.author_association == 'COLLABORATOR')) |
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
Adds the Claude Code GitHub Actions workflow to this repo, mirroring the production setup in stellar/stellar-dbt#833.
This lets repo
OWNERs andCOLLABORATORs invoke Claude on PRs and issues by@claude-tagging in a comment, review, or issue body.How it works
issue_comment,pull_request_review_comment,pull_request_review,issues, andworkflow_dispatchif:gate restricts invocation toOWNER/COLLABORATOR(this is a public repo, soMEMBERis intentionally excluded — only the org owner and explicitly-invited collaborators can invoke)permissions:block (nocontents: write); noBash(...)allowlist on the actionSetup required before this can be used (repo admin)
stellar-dbt, the federation rule is shared):ANTHROPIC_FEDERATION_RULE_IDANTHROPIC_ORGANIZATION_IDANTHROPIC_SERVICE_ACCOUNT_IDANTHROPIC_WORKSPACE_IDrepositoryclaim filter acceptsstellar/stellar-etlTest plan
gh workflow run claude.yml --ref minor/add-claude-workflowruns and the auth step succeeds@claudecomment from a collaborator on a PR successfully invokes the action