askill
gh-action-config

gh-action-configSafety 95Repository

Configure the anthropics/claude-code-action GitHub Action correctly. Use when setting up Claude Code workflows, troubleshooting GitHub Action configuration, or passing CLI flags via claude_args.

0 stars
1.2k downloads
Updated 1/31/2026

Package Files

Loading files...
SKILL.md

Claude Code GitHub Action Configuration Guide

This skill helps you properly configure the anthropics/claude-code-action GitHub Action, avoiding common pitfalls with inputs and CLI flags.

Key Concept: Action Inputs vs CLI Flags

The most common mistake is confusing action inputs with CLI flags. They are NOT interchangeable.

  • Action inputs: Defined in workflow YAML directly under with:
  • CLI flags: Must be passed through the claude_args input

Common Mistake: Invalid Direct Inputs

These parameters look like they should work as action inputs, but they will be ignored with warnings:

# ❌ WRONG - These are NOT valid action inputs
- uses: anthropics/claude-code-action@v1
  with:
    model: claude-opus-4-5-20251101           # ❌ Ignored
    allowed_tools: "Bash(bun *)"              # ❌ Ignored
    append_system_prompt: "Your prompt"       # ❌ Ignored

Correct Approach: Use claude_args

Pass CLI flags through the claude_args input:

# ✅ CORRECT - Pass CLI flags via claude_args
- uses: anthropics/claude-code-action@v1
  with:
    claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

    claude_args: >-
      --model claude-opus-4-5-20251101
      --allowedTools "Bash(bun *)"
      --append-system-prompt "After making code changes, run tests."
      --debug

Complete Working Example

name: Claude Code

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

jobs:
  claude:
    if: |
      (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
      (github.event_name == 'issues' && (github.event.action == 'assigned' || github.event.action == 'labeled')) ||
      github.event_name == 'pull_request_review_comment'
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      issues: write
      actions: read
    steps:
      - name: Run Claude Code
        uses: anthropics/claude-code-action@v1
        with:
          claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

          # Valid action inputs
          trigger_phrase: "@claude"
          use_sticky_comment: true
          additional_permissions: |
            actions: read

          # CLI flags via claude_args
          claude_args: >-
            --model claude-opus-4-5-20251101
            --allowedTools "Bash(bun *)"
            --append-system-prompt "Run 'bun run build' after making changes."
            --debug

Valid Action Inputs Reference

These inputs can be used directly under with::

Authentication

InputDescription
anthropic_api_keyAnthropic API key
claude_code_oauth_tokenClaude Code OAuth token (preferred)
github_tokenGitHub token (defaults to ${{ github.token }})

Triggers

InputDescription
trigger_phrasePhrase to trigger Claude (default: @claude)
assignee_triggerTrigger when issue is assigned
label_triggerTrigger when label is added

Branching

InputDescription
base_branchBase branch for new branches
branch_prefixPrefix for created branches
branch_name_templateTemplate for branch names

Access Control

InputDescription
allowed_botsBots allowed to trigger
allowed_non_write_usersUsers without write access who can trigger
include_comments_by_actorInclude comments by specific actors
exclude_comments_by_actorExclude comments by specific actors

Configuration

InputDescription
promptCustom prompt for Claude
settingsJSON string or path to settings file
claude_argsCLI flags go here
additional_permissionsExtra GitHub permissions

Providers

InputDescription
use_bedrockUse AWS Bedrock
use_vertexUse Google Vertex AI
use_foundryUse Foundry

Features

InputDescription
use_sticky_commentUpdate same comment vs create new
use_commit_signingSign commits

CLI Flags for claude_args

Common CLI flags to pass via claude_args:

FlagPurposeExample
--modelSet the model--model claude-opus-4-5-20251101
--allowedToolsAllow specific tool patterns--allowedTools "Bash(bun *)"
--append-system-promptAdd to system prompt--append-system-prompt "Run tests"
--debugEnable debug logging--debug
--max-turnsLimit agent turns--max-turns 10

Pattern Matching for --allowedTools

The --allowedTools flag uses pattern matching:

claude_args: >-
  --allowedTools "Bash(bun *)"      # Any bun command
  --allowedTools "Bash(npm run *)"  # Any npm run script
  --allowedTools "Bash(git add *)"  # Git add commands

Pattern Syntax

  • * matches any characters: Bash(bun *) matches bun install, bun run build, etc.
  • Specific commands: Bash(git commit -m *) matches only git commit with message
  • Multiple patterns: Use separate --allowedTools flags for each pattern

Troubleshooting

"Input not defined" Warnings

If you see warnings about undefined inputs, you're likely using CLI flags as direct inputs. Move them to claude_args.

Model Not Changing

Ensure you're using --model inside claude_args, not as a direct input:

# ❌ Wrong
model: claude-opus-4-5-20251101

# ✅ Correct
claude_args: --model claude-opus-4-5-20251101

allowedTools Not Working

Check the pattern syntax and ensure it's in claude_args:

# ❌ Wrong - not valid action input
allowed_tools: "Bash(bun *)"

# ✅ Correct - in claude_args with proper flag name
claude_args: --allowedTools "Bash(bun *)"

Additional Resources

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/11/2026

An exceptional technical reference and guide for configuring the Claude Code GitHub Action. It clearly addresses a major pain point (inputs vs flags) and provides exhaustive reference tables and examples.

95
100
90
98
100

Metadata

Licenseunknown
Version-
Updated1/31/2026
Publisherfirstloophq

Tags

apici-cdgithubgithub-actionsllmobservabilityprompting