mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
feat: add structured output support
This commit is contained in:
10
.github/workflows/test-structured-output.yml
vendored
10
.github/workflows/test-structured-output.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
|||||||
"required": ["text_field", "number_field", "boolean_true", "boolean_false"]
|
"required": ["text_field", "number_field", "boolean_true", "boolean_false"]
|
||||||
}
|
}
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
allowed_tools: "Bash"
|
claude_args: "--allowedTools Bash"
|
||||||
|
|
||||||
- name: Verify outputs
|
- name: Verify outputs
|
||||||
run: |
|
run: |
|
||||||
@@ -111,7 +111,7 @@ jobs:
|
|||||||
"required": ["items", "config", "empty_array"]
|
"required": ["items", "config", "empty_array"]
|
||||||
}
|
}
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
allowed_tools: "Bash"
|
claude_args: "--allowedTools Bash"
|
||||||
|
|
||||||
- name: Verify JSON stringification
|
- name: Verify JSON stringification
|
||||||
run: |
|
run: |
|
||||||
@@ -172,7 +172,7 @@ jobs:
|
|||||||
"required": ["zero", "empty_string", "negative", "decimal"]
|
"required": ["zero", "empty_string", "negative", "decimal"]
|
||||||
}
|
}
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
allowed_tools: "Bash"
|
claude_args: "--allowedTools Bash"
|
||||||
|
|
||||||
- name: Verify edge cases
|
- name: Verify edge cases
|
||||||
run: |
|
run: |
|
||||||
@@ -233,7 +233,7 @@ jobs:
|
|||||||
"required": ["test-result", "item_count"]
|
"required": ["test-result", "item_count"]
|
||||||
}
|
}
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
allowed_tools: "Bash"
|
claude_args: "--allowedTools Bash"
|
||||||
|
|
||||||
- name: Verify sanitized names work
|
- name: Verify sanitized names work
|
||||||
run: |
|
run: |
|
||||||
@@ -277,7 +277,7 @@ jobs:
|
|||||||
"required": ["done"]
|
"required": ["done"]
|
||||||
}
|
}
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
allowed_tools: "Bash"
|
claude_args: "--allowedTools Bash"
|
||||||
|
|
||||||
- name: Verify execution file contains structured_output
|
- name: Verify execution file contains structured_output
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ outputs:
|
|||||||
github_token:
|
github_token:
|
||||||
description: "The GitHub token used by the action (Claude App token if available)"
|
description: "The GitHub token used by the action (Claude App token if available)"
|
||||||
value: ${{ steps.prepare.outputs.github_token }}
|
value: ${{ steps.prepare.outputs.github_token }}
|
||||||
|
structured_output:
|
||||||
|
description: "JSON string containing all structured output fields when json_schema input is provided. Use fromJSON() to parse: fromJSON(steps.id.outputs.structured_output).field_name"
|
||||||
|
value: ${{ steps.claude-code.outputs.structured_output }}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
|||||||
@@ -24,10 +24,6 @@ inputs:
|
|||||||
description: "Additional arguments to pass directly to Claude CLI (e.g., '--max-turns 3 --mcp-config /path/to/config.json')"
|
description: "Additional arguments to pass directly to Claude CLI (e.g., '--max-turns 3 --mcp-config /path/to/config.json')"
|
||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
allowed_tools:
|
|
||||||
description: "Comma-separated list of allowed tools (e.g., 'Read,Write,Bash'). Passed as --allowedTools to Claude CLI"
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
|
|
||||||
# Authentication settings
|
# Authentication settings
|
||||||
anthropic_api_key:
|
anthropic_api_key:
|
||||||
@@ -156,7 +152,6 @@ runs:
|
|||||||
INPUT_SHOW_FULL_OUTPUT: ${{ inputs.show_full_output }}
|
INPUT_SHOW_FULL_OUTPUT: ${{ inputs.show_full_output }}
|
||||||
INPUT_PLUGINS: ${{ inputs.plugins }}
|
INPUT_PLUGINS: ${{ inputs.plugins }}
|
||||||
INPUT_PLUGIN_MARKETPLACES: ${{ inputs.plugin_marketplaces }}
|
INPUT_PLUGIN_MARKETPLACES: ${{ inputs.plugin_marketplaces }}
|
||||||
INPUT_ALLOWED_TOOLS: ${{ inputs.allowed_tools }}
|
|
||||||
JSON_SCHEMA: ${{ inputs.json_schema }}
|
JSON_SCHEMA: ${{ inputs.json_schema }}
|
||||||
|
|
||||||
# Provider configuration
|
# Provider configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user