diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..561e258 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - run: npm ci + - run: npm run lint diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml index 443c398..a48458a 100644 --- a/.github/workflows/upstream-sync.yml +++ b/.github/workflows/upstream-sync.yml @@ -5,6 +5,7 @@ on: # Every Monday at 9 AM UTC - cron: "0 9 * * 1" workflow_dispatch: + inputs: {} permissions: contents: write diff --git a/README.md b/README.md index 23940aa..4d821e3 100644 --- a/README.md +++ b/README.md @@ -113,43 +113,43 @@ Variables substituted via `envsubst` at runtime:
Full input reference -| Input | Description | Default | -| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | -| `mode` | `interactive` or `review` | `interactive` | -| `pr_number` | PR number (required for review mode) | `''` | -| `prompt_dir` | Override prompt directory | `interactive` / `review` | -| `claude_args` | Override claude args | Auto-generated based on mode | -| `claude_code_oauth_token` | Claude Code OAuth token | Required\* | -| `anthropic_api_key` | Anthropic API key (alternative to OAuth) | - | -| `github_token` | GitHub token | Uses `github.token` | -| `track_progress` | Enable progress tracking with checkboxes | `false` | -| `include_fix_links` | Include 'Fix this' links in PR feedback | `true` | -| `use_sticky_comment` | Use single sticky comment for PR feedback | `false` | -| `trigger_phrase` | Custom trigger phrase | `@claude` | -| `assignee_trigger` | Assignee that triggers on issue assignment | - | -| `label_trigger` | Label that triggers when applied to issue | `claude` | -| `base_branch` | Branch to use as base when creating new branches | Repository default | -| `branch_prefix` | Prefix for Claude branches | `claude/` | -| `branch_name_template` | Template for branch naming (supports {{prefix}}, {{entityType}}, {{entityNumber}}, {{timestamp}}, {{sha}}, {{label}}, {{description}}) | Default format | -| `additional_permissions` | Extra permissions (e.g., `actions: read`) | - | -| `allowed_bots` | Comma-separated allowed bot usernames, or '\*' to allow all | No bots allowed | -| `allowed_non_write_users` | Comma-separated usernames to allow without write permissions. WARNING: Use with extreme caution | - | -| `include_comments_by_actor` | Comma-separated list to INCLUDE in comments. Supports wildcards like '\*[bot]' | All actors included | -| `exclude_comments_by_actor` | Comma-separated list to EXCLUDE from comments. Supports wildcards like '\*[bot]'. Exclusion takes priority | None excluded | -| `use_commit_signing` | Enable commit signing via GitHub API | `false` | -| `ssh_signing_key` | SSH private key for signing commits | - | -| `bot_id` | GitHub user ID for git operations | `41898282` | -| `bot_name` | GitHub username for git operations | `claude[bot]` | -| `settings` | Claude Code settings (JSON or file path) | - | -| `plugins` | Newline-separated plugins to install | - | -| `plugin_marketplaces` | Newline-separated marketplace Git URLs | - | -| `use_bedrock` | Use Amazon Bedrock with OIDC | `false` | -| `use_vertex` | Use Google Vertex AI with OIDC | `false` | -| `use_foundry` | Use Microsoft Foundry with OIDC | `false` | -| `path_to_claude_code_executable` | Optional path to custom Claude Code executable. WARNING: May cause issues if outdated | - | -| `path_to_bun_executable` | Optional path to custom Bun executable. WARNING: May cause issues if incompatible | - | -| `display_report` | Whether to display the Claude Code Report in GitHub Step Summary. Set to 'false' to disable when using custom formatting solutions. | `true` | -| `show_full_output` | Show full JSON output. WARNING: May expose secrets in public logs | `false` | +| Input | Description | Default | +| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | +| `mode` | `interactive` or `review` | `interactive` | +| `pr_number` | PR number (required for review mode) | `''` | +| `prompt_dir` | Override prompt directory | `interactive` / `review` | +| `claude_args` | Override claude args | Auto-generated based on mode | +| `claude_code_oauth_token` | Claude Code OAuth token | Required\* | +| `anthropic_api_key` | Anthropic API key (alternative to OAuth) | - | +| `github_token` | GitHub token | Uses `github.token` | +| `track_progress` | Enable progress tracking with checkboxes | `false` | +| `include_fix_links` | Include 'Fix this' links in PR feedback | `true` | +| `use_sticky_comment` | Use single sticky comment for PR feedback | `false` | +| `trigger_phrase` | Custom trigger phrase | `@claude` | +| `assignee_trigger` | Assignee that triggers on issue assignment | - | +| `label_trigger` | Label that triggers when applied to issue | `claude` | +| `base_branch` | Branch to use as base when creating new branches | Repository default | +| `branch_prefix` | Prefix for Claude branches | `claude/` | +| `branch_name_template` | Template for branch naming (supports {{prefix}}, {{entityType}}, {{entityNumber}}, {{timestamp}}, {{sha}}, {{label}}, {{description}}) | Default format | +| `additional_permissions` | Extra permissions (e.g., `actions: read`) | - | +| `allowed_bots` | Comma-separated allowed bot usernames, or '\*' to allow all | No bots allowed | +| `allowed_non_write_users` | Comma-separated usernames to allow without write permissions. WARNING: Use with extreme caution | - | +| `include_comments_by_actor` | Comma-separated list to INCLUDE in comments. Supports wildcards like '\*\[bot\]' | All actors included | +| `exclude_comments_by_actor` | Comma-separated list to EXCLUDE from comments. Supports wildcards like '\*\[bot\]'. Exclusion takes priority | None excluded | +| `use_commit_signing` | Enable commit signing via GitHub API | `false` | +| `ssh_signing_key` | SSH private key for signing commits | - | +| `bot_id` | GitHub user ID for git operations | `41898282` | +| `bot_name` | GitHub username for git operations | `claude[bot]` | +| `settings` | Claude Code settings (JSON or file path) | - | +| `plugins` | Newline-separated plugins to install | - | +| `plugin_marketplaces` | Newline-separated marketplace Git URLs | - | +| `use_bedrock` | Use Amazon Bedrock with OIDC | `false` | +| `use_vertex` | Use Google Vertex AI with OIDC | `false` | +| `use_foundry` | Use Microsoft Foundry with OIDC | `false` | +| `path_to_claude_code_executable` | Optional path to custom Claude Code executable. WARNING: May cause issues if outdated | - | +| `path_to_bun_executable` | Optional path to custom Bun executable. WARNING: May cause issues if incompatible | - | +| `display_report` | Whether to display the Claude Code Report in GitHub Step Summary. Set to 'false' to disable when using custom formatting solutions. | `true` | +| `show_full_output` | Show full JSON output. WARNING: May expose secrets in public logs | `false` | \*Either `claude_code_oauth_token` or `anthropic_api_key` is required. @@ -157,13 +157,13 @@ Variables substituted via `envsubst` at runtime: ### Action Outputs -| Output | Description | -| ------------------- | ---------------------------------------------------------------- | -| `execution_file` | Path to Claude Code execution output | -| `branch_name` | The branch created by Claude Code for this execution | -| `github_token` | The GitHub token used by the action (Claude App token if available). **Sensitive** — do not log or upload as an artifact. | -| `structured_output` | JSON output when using `--json-schema` | -| `session_id` | Claude Code session ID that can be used with --resume | +| Output | Description | +| ------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `execution_file` | Path to Claude Code execution output | +| `branch_name` | The branch created by Claude Code for this execution | +| `github_token` | The GitHub token used by the action (Claude App token if available). **Sensitive** — do not log or upload as an artifact. | +| `structured_output` | JSON string containing all structured output fields when `--json-schema` is provided in `claude_args`. Use `fromJSON()` to parse | +| `session_id` | Claude Code session ID that can be used with --resume | ## Examples diff --git a/action.yml b/action.yml index 4baa712..7293814 100644 --- a/action.yml +++ b/action.yml @@ -164,7 +164,7 @@ outputs: description: "The GitHub token used by the action (Claude App token if available)" value: ${{ steps.claude.outputs.github_token }} structured_output: - description: "JSON output when using --json-schema" + description: "JSON string containing all structured output fields when --json-schema is provided in claude_args. Use fromJSON() to parse: fromJSON(steps.id.outputs.structured_output).field_name" value: ${{ steps.claude.outputs.structured_output }} session_id: description: "The Claude Code session ID that can be used with --resume to continue this conversation"