Skip to content

Add Claude Code workflow (WIF auth)#424

Open
chowbao wants to merge 1 commit intomasterfrom
minor/add-claude-workflow
Open

Add Claude Code workflow (WIF auth)#424
chowbao wants to merge 1 commit intomasterfrom
minor/add-claude-workflow

Conversation

@chowbao
Copy link
Copy Markdown
Contributor

@chowbao chowbao commented May 6, 2026

Summary

Adds the Claude Code GitHub Actions workflow to this repo, mirroring the production setup in stellar/stellar-dbt#833.

This lets repo OWNERs and COLLABORATORs invoke Claude on PRs and issues by @claude-tagging in a comment, review, or issue body.

How it works

  • Triggers on issue_comment, pull_request_review_comment, pull_request_review, issues, and workflow_dispatch
  • Job-level if: gate restricts invocation to OWNER / COLLABORATOR (this is a public repo, so MEMBER is intentionally excluded — only the org owner and explicitly-invited collaborators can invoke)
  • Authenticates to Anthropic via GitHub OIDC + Workload Identity Federation — no long-lived API key in repo secrets
  • Read-only permissions: block (no contents: write); no Bash(...) allowlist on the action

Setup required before this can be used (repo admin)

  • Add four GitHub Actions secrets (same values as stellar-dbt, the federation rule is shared):
    • ANTHROPIC_FEDERATION_RULE_ID
    • ANTHROPIC_ORGANIZATION_ID
    • ANTHROPIC_SERVICE_ACCOUNT_ID
    • ANTHROPIC_WORKSPACE_ID
  • Confirm the Anthropic federation rule's repository claim filter accepts stellar/stellar-etl

Test plan

  • After secrets are added, gh workflow run claude.yml --ref minor/add-claude-workflow runs and the auth step succeeds
  • An @claude comment from a collaborator on a PR successfully invokes the action

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.
Copilot AI review requested due to automatic review settings May 6, 2026 21:57
@chowbao chowbao requested a review from a team as a code owner May 6, 2026 21:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml workflow 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'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants