Skip to content

Commit 4071931

Browse files
committed
Update README with new inputs, outputs, and examples
Documentation updates: New Inputs: - timeout: Timeout in seconds for agent execution - debug: Enable debug mode with verbose logging - github-token: Now properly documented with default value New Outputs: - output-file: Path to the output log file (was missing) - cagent-version: Version of cagent that was used - mcp-gateway-installed: Whether mcp-gateway was installed - execution-time: Agent execution time in seconds New Examples: - Updated Advanced Configuration to show timeout and debug inputs - Added 'Using Outputs' section demonstrating: - How to access action outputs in subsequent steps - Conditional logic based on execution time - Uploading output log as artifact All examples updated to reflect new capabilities while maintaining backward compatibility with existing workflows.
1 parent 7fbbc04 commit 4071931

File tree

2 files changed

+74
-40
lines changed

2 files changed

+74
-40
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,41 @@ jobs:
6464
mcp-gateway-version: v0.22.0
6565
yolo: false # Require manual approval
6666
tui: true # Enable terminal UI
67+
timeout: 600 # 10 minute timeout
68+
debug: true # Enable debug logging
6769
working-directory: ./src
6870
extra-args: "--verbose"
6971
env:
7072
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
7173
```
7274
75+
### Using Outputs
76+
77+
```yaml
78+
- name: Run CAgent
79+
id: agent
80+
uses: docker/cagent-action@v1
81+
with:
82+
agent: jeanlaurent/pr-reviewer
83+
prompt: "Review this pull request"
84+
env:
85+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
86+
87+
- name: Check execution time
88+
run: |
89+
echo "Agent took ${{ steps.agent.outputs.execution-time }} seconds"
90+
if [ "${{ steps.agent.outputs.execution-time }}" -gt 300 ]; then
91+
echo "Warning: Agent took longer than 5 minutes"
92+
fi
93+
94+
- name: Upload output log
95+
if: always()
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: agent-output
99+
path: ${{ steps.agent.outputs.output-file }}
100+
```
101+
73102
## Inputs
74103
75104
| Input | Description | Required | Default |
@@ -82,7 +111,9 @@ jobs:
82111
| `anthropic-api-key` | Anthropic API key | No | `$ANTHROPIC_API_KEY` env var |
83112
| `openai-api-key` | OpenAI API key | No | `$OPENAI_API_KEY` env var |
84113
| `google-api-key` | Google API key for Gemini | No | `$GOOGLE_API_KEY` env var |
85-
| `github-token` | GitHub token for API access | No | `${{ github.token }}` |
114+
| `github-token` | GitHub token for API access | No | Auto-provided by GitHub Actions |
115+
| `timeout` | Timeout in seconds for agent execution (0 for no timeout) | No | `0` |
116+
| `debug` | Enable debug mode with verbose logging (`true`/`false`) | No | `false` |
86117
| `working-directory` | Working directory to run the agent in | No | `.` |
87118
| `tui` | Enable TUI mode (`true`/`false`) | No | `false` |
88119
| `yolo` | Auto-approve all prompts (`true`/`false`) | No | `true` |
@@ -93,6 +124,10 @@ jobs:
93124
| Output | Description |
94125
|--------|-------------|
95126
| `exit-code` | Exit code from the cagent run |
127+
| `output-file` | Path to the output log file |
128+
| `cagent-version` | Version of cagent that was used |
129+
| `mcp-gateway-installed` | Whether mcp-gateway was installed (`true`/`false`) |
130+
| `execution-time` | Agent execution time in seconds |
96131

97132
## Environment Variables
98133

action.yml

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,85 @@
1-
name: 'CAgent Runner'
2-
description: 'Run a CAgent AI agent with a single line'
3-
author: 'Docker'
1+
name: "CAgent Runner"
2+
description: "Run a CAgent AI agent with a single line"
3+
author: "Docker"
44
branding:
5-
icon: 'cpu'
6-
color: 'blue'
5+
icon: "cpu"
6+
color: "blue"
77

88
inputs:
99
agent:
10-
description: 'Agent identifier (e.g., jeanlaurent/pr-reviewer or path to .yaml file)'
10+
description: "Agent identifier (e.g., jeanlaurent/pr-reviewer or path to .yaml file)"
1111
required: true
1212
prompt:
13-
description: 'Prompt to pass to the agent. If not provided, uses a default based on the agent type'
13+
description: "Prompt to pass to the agent. If not provided, uses a default based on the agent type"
1414
required: false
1515
cagent-version:
16-
description: 'Version of cagent to use'
16+
description: "Version of cagent to use"
1717
required: false
18-
default: 'v1.6.6'
18+
default: "v1.6.6"
1919
mcp-gateway:
20-
description: 'Install mcp-gateway (true/false)'
20+
description: "Install mcp-gateway (true/false)"
2121
required: false
22-
default: 'false'
22+
default: "false"
2323
mcp-gateway-version:
24-
description: 'Version of mcp-gateway to use (specifying this will enable mcp-gateway installation)'
24+
description: "Version of mcp-gateway to use (specifying this will enable mcp-gateway installation)"
2525
required: false
26-
default: 'v0.22.0'
26+
default: "v0.22.0"
2727
anthropic-api-key:
28-
description: 'Anthropic API key (defaults to ANTHROPIC_API_KEY secret)'
28+
description: "Anthropic API key (defaults to ANTHROPIC_API_KEY secret)"
2929
required: false
3030
openai-api-key:
31-
description: 'OpenAI API key (defaults to OPENAI_API_KEY secret)'
31+
description: "OpenAI API key (defaults to OPENAI_API_KEY secret)"
3232
required: false
3333
google-api-key:
34-
description: 'Google API key for Gemini (defaults to GOOGLE_API_KEY secret)'
34+
description: "Google API key for Gemini (defaults to GOOGLE_API_KEY secret)"
3535
required: false
3636
github-token:
37-
description: 'GitHub token for API access'
37+
description: "GitHub token for API access (defaults to GITHUB_TOKEN env var)"
3838
required: false
39-
default: ${{ github.token }}
4039
timeout:
41-
description: 'Timeout in seconds for agent execution (0 for no timeout)'
40+
description: "Timeout in seconds for agent execution (0 for no timeout)"
4241
required: false
43-
default: '0'
42+
default: "0"
4443
debug:
45-
description: 'Enable debug mode with verbose logging (true/false)'
44+
description: "Enable debug mode with verbose logging (true/false)"
4645
required: false
47-
default: 'false'
46+
default: "false"
4847
working-directory:
49-
description: 'Working directory to run the agent in'
48+
description: "Working directory to run the agent in"
5049
required: false
51-
default: '.'
50+
default: "."
5251
tui:
53-
description: 'Enable TUI mode (true/false)'
52+
description: "Enable TUI mode (true/false)"
5453
required: false
55-
default: 'false'
54+
default: "false"
5655
yolo:
57-
description: 'Enable yolo mode - auto-approve all prompts (true/false)'
56+
description: "Enable yolo mode - auto-approve all prompts (true/false)"
5857
required: false
59-
default: 'true'
58+
default: "true"
6059
extra-args:
61-
description: 'Additional arguments to pass to cagent run'
60+
description: "Additional arguments to pass to cagent run"
6261
required: false
63-
default: ''
62+
default: ""
6463

6564
outputs:
6665
exit-code:
67-
description: 'Exit code from cagent run'
66+
description: "Exit code from cagent run"
6867
value: ${{ steps.run-agent.outputs.exit-code }}
6968
output-file:
70-
description: 'Path to the output log file'
69+
description: "Path to the output log file"
7170
value: ${{ steps.run-agent.outputs.output-file }}
7271
cagent-version:
73-
description: 'Version of cagent that was used'
72+
description: "Version of cagent that was used"
7473
value: ${{ steps.setup-binaries.outputs.cagent-version }}
7574
mcp-gateway-installed:
76-
description: 'Whether mcp-gateway was installed (true/false)'
75+
description: "Whether mcp-gateway was installed (true/false)"
7776
value: ${{ steps.setup-binaries.outputs.mcp-installed }}
7877
execution-time:
79-
description: 'Agent execution time in seconds'
78+
description: "Agent execution time in seconds"
8079
value: ${{ steps.run-agent.outputs.execution-time }}
8180

8281
runs:
83-
using: 'composite'
82+
using: "composite"
8483
steps:
8584
- name: Validate versions
8685
shell: bash
@@ -108,15 +107,15 @@ runs:
108107
109108
- name: Cache cagent binary
110109
id: cache-cagent
111-
uses: actions/cache@v4
110+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
112111
with:
113112
path: ${{ github.workspace }}/cagent
114113
key: cagent-${{ runner.os }}-${{ inputs.cagent-version }}
115114

116115
- name: Cache mcp-gateway binary
117116
id: cache-mcp
118117
if: ${{ inputs.mcp-gateway == 'true' }}
119-
uses: actions/cache@v4
118+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
120119
with:
121120
path: ~/.docker/cli-plugins/docker-mcp
122121
key: mcp-gateway-${{ runner.os }}-${{ inputs.mcp-gateway-version }}
@@ -206,7 +205,7 @@ runs:
206205
ANTHROPIC_API_KEY: ${{ inputs.anthropic-api-key || env.ANTHROPIC_API_KEY }}
207206
OPENAI_API_KEY: ${{ inputs.openai-api-key || env.OPENAI_API_KEY }}
208207
GOOGLE_API_KEY: ${{ inputs.google-api-key || env.GOOGLE_API_KEY }}
209-
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ inputs.github-token }}
208+
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ inputs.github-token || github.token }}
210209
run: |
211210
set -e
212211

0 commit comments

Comments
 (0)