agentleFS
CodySwannGTCodySwannGT/lisa/.agents/skills/claude-code-action/SKILL.md

claude-code-action

Skill4 starsChanged 3 months agoMITView on GitHub

Knowledge base for creating and configuring Claude Code Action GitHub workflows

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add it as a GitHub repository secret:

    line 30
  2. Distinctive:

    Before running nightly workflows, check for existing open PRs:

    line 157
  3. Very specific:

    Use --max-turns to limit API usage:

    line 184
  4. Distinctive:

    Never hardcode secrets in workflow files

    line 199
  5. Very specific:

    Use ${{ secrets.* }} for all sensitive values

    line 200
  6. Very specific:

    Use allowed_bots to control which bots can trigger Claude

    line 202

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Claude Code Action Workflow Guide

Reference guide for creating anthropics/claude-code-action@v1 GitHub workflows.

Authentication

Choose one authentication method:

MethodInputUse Case
OAuth Tokenclaude_code_oauth_tokenRecommended for most setups (requires Claude Pro or Max)
API Keyanthropic_api_keyDirect Anthropic API key from console.anthropic.com
AWS Bedrockaws_access_key_id + aws_secret_access_keyAWS-hosted Claude
GCP Vertexgcp_project_id + gcp_region + gcp_workload_identity_providerGoogle Cloud Claude

Getting CLAUDE_CODE_OAUTH_TOKEN

Requires a Claude Pro or Max subscription.

  1. Run locally:
    claude setup-token
  2. Copy the output token
  3. Add it as a GitHub repository secret:
    gh secret set CLAUDE_CODE_OAUTH_TOKEN
    Paste the token when prompted.

On macOS, Claude Code stores credentials in the encrypted Keychain (not a plain file). The setup-token command is the official way to extract a token for CI use.

Repository Configuration

NameTypeRequired ForHow to Set
CLAUDE_CODE_OAUTH_TOKENSecretAll Claude workflowsgh secret set CLAUDE_CODE_OAUTH_TOKEN
ENABLE_CLAUDE_NIGHTLYVariableNightly workflows (opt-in)gh variable set ENABLE_CLAUDE_NIGHTLY --body "true"

Workflow Patterns

Interactive (PR/Issue mentions)

Triggered when users mention @claude in comments, reviews, or issues.

on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]
  issues:
    types: [opened, assigned]
  pull_request_review:
    types: [submitted]

CI Auto-Fix (Automation)

Triggered when a CI workflow fails. Automatically fixes the code.

on:
  workflow_run:
    workflows: ["CI Quality Checks"]
    types: [completed]

Guard against infinite loops:

if: |
  github.event.workflow_run.conclusion == 'failure' &&
  !startsWith(github.event.workflow_run.head_branch, 'claude-auto-fix-') &&
  github.event.workflow_run.head_branch != 'main' &&
  github.event.workflow_run.head_branch != 'staging' &&
  github.event.workflow_run.head_branch != 'dev'

Nightly/Scheduled

Runs on a cron schedule for maintenance tasks (test improvement, coverage).

on:
  schedule:
    - cron: '0 3 * * 1-5'  # 3 AM UTC weekdays
  workflow_dispatch:

Use opt-in guard:

if: vars.ENABLE_CLAUDE_NIGHTLY == 'true'

Standard Permissions Block

permissions:
  contents: write
  pull-requests: write
  issues: write
  actions: read
  id-token: write

Tool Allowlisting

Standard allowedTools for Lisa projects:

Edit,MultiEdit,Write,Read,Glob,Grep,Bash(git:*),Bash(npm:*),Bash(npx:*),Bash(bun:*),Bash(yarn:*),Bash(pnpm:*),Bash(gh:*)

This covers:

  • File operations: Edit, MultiEdit, Write, Read, Glob, Grep
  • Git: Bash(git:*) -- commit, push, branch, etc.
  • Package managers: npm, npx, bun, yarn, pnpm
  • GitHub CLI: Bash(gh:*) -- create PRs, issues, etc.

Key Inputs

InputRequiredDescription
promptNoTask instructions for Claude
claude_code_oauth_tokenYes*OAuth token for authentication
claude_argsNoCLI args: --allowedTools, --max-turns, --system-prompt, --mcp-config
branch_prefixNoPrefix for auto-created branches (e.g., claude/nightly-)
additional_permissionsNoExtra GitHub permissions (e.g., actions: read)
max_turnsNoMax agentic turns (via claude_args --max-turns)
track_progressNoEnable progress tracking comments
allowed_botsNoComma-separated bot names allowed to trigger
allowed_non_write_usersNoUsers without write access who can trigger

MCP Configuration

Pass MCP server config via claude_args:

claude_args: |
  --mcp-config .mcp.json

Pass secrets to MCP servers via environment variables in the workflow.

Patterns

Duplicate PR Prevention

Before running nightly workflows, check for existing open PRs:

- name: Check for existing PR
  id: check-pr
  uses: actions/github-script@v7
  with:
    script: |
      const pulls = await github.rest.pulls.list({
        owner: context.repo.owner,
        repo: context.repo.repo,
        state: 'open',
        per_page: 100,
      });
      const existing = pulls.data.find(pr =>
        pr.head.ref.startsWith('claude/nightly-') &&
        pr.title.toLowerCase().includes('your-keyword')
      );
      core.setOutput('has_existing_pr', existing ? 'true' : 'false');

- name: Run Claude
  if: steps.check-pr.outputs.has_existing_pr != 'true'
  uses: anthropics/claude-code-action@v1

Cost Control

Use --max-turns to limit API usage:

claude_args: |
  --max-turns 25

Recommended limits:

  • Interactive (PR/issue): No limit (user-driven)
  • CI auto-fix: 25 turns
  • Nightly workflows: 40 turns

Security

  • Never hardcode secrets in workflow files
  • Use ${{ secrets.* }} for all sensitive values
  • Sanitize dynamic content in prompts to prevent injection
  • Use allowed_bots to control which bots can trigger Claude

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.