Skip to content

Commit 33fa6c9

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 31cacd3 commit 33fa6c9

File tree

2 files changed

+76
-37
lines changed

2 files changed

+76
-37
lines changed

README.md

Lines changed: 35 additions & 0 deletions
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 |
@@ -83,6 +112,8 @@ jobs:
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 |
85114
| `github-token` | GitHub token for API access | No | `${{ github.token }}` |
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: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,86 @@
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"
3838
required: false
3939
default: ${{ github.token }}
4040
timeout:
41-
description: 'Timeout in seconds for agent execution (0 for no timeout)'
41+
description: "Timeout in seconds for agent execution (0 for no timeout)"
4242
required: false
43-
default: '0'
43+
default: "0"
4444
debug:
45-
description: 'Enable debug mode with verbose logging (true/false)'
45+
description: "Enable debug mode with verbose logging (true/false)"
4646
required: false
47-
default: 'false'
47+
default: "false"
4848
working-directory:
49-
description: 'Working directory to run the agent in'
49+
description: "Working directory to run the agent in"
5050
required: false
51-
default: '.'
51+
default: "."
5252
tui:
53-
description: 'Enable TUI mode (true/false)'
53+
description: "Enable TUI mode (true/false)"
5454
required: false
55-
default: 'false'
55+
default: "false"
5656
yolo:
57-
description: 'Enable yolo mode - auto-approve all prompts (true/false)'
57+
description: "Enable yolo mode - auto-approve all prompts (true/false)"
5858
required: false
59-
default: 'true'
59+
default: "true"
6060
extra-args:
61-
description: 'Additional arguments to pass to cagent run'
61+
description: "Additional arguments to pass to cagent run"
6262
required: false
63-
default: ''
63+
default: ""
6464

6565
outputs:
6666
exit-code:
67-
description: 'Exit code from cagent run'
67+
description: "Exit code from cagent run"
6868
value: ${{ steps.run-agent.outputs.exit-code }}
6969
output-file:
70-
description: 'Path to the output log file'
70+
description: "Path to the output log file"
7171
value: ${{ steps.run-agent.outputs.output-file }}
7272
cagent-version:
73-
description: 'Version of cagent that was used'
73+
description: "Version of cagent that was used"
7474
value: ${{ steps.setup-binaries.outputs.cagent-version }}
7575
mcp-gateway-installed:
76-
description: 'Whether mcp-gateway was installed (true/false)'
76+
description: "Whether mcp-gateway was installed (true/false)"
7777
value: ${{ steps.setup-binaries.outputs.mcp-installed }}
7878
execution-time:
79-
description: 'Agent execution time in seconds'
79+
description: "Agent execution time in seconds"
8080
value: ${{ steps.run-agent.outputs.execution-time }}
8181

8282
runs:
83-
using: 'composite'
83+
using: "composite"
8484
steps:
8585
- name: Validate versions
8686
shell: bash
@@ -108,15 +108,15 @@ runs:
108108
109109
- name: Cache cagent binary
110110
id: cache-cagent
111-
uses: actions/cache@v4
111+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
112112
with:
113113
path: ${{ github.workspace }}/cagent
114114
key: cagent-${{ runner.os }}-${{ inputs.cagent-version }}
115115

116116
- name: Cache mcp-gateway binary
117117
id: cache-mcp
118118
if: ${{ inputs.mcp-gateway == 'true' }}
119-
uses: actions/cache@v4
119+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
120120
with:
121121
path: ~/.docker/cli-plugins/docker-mcp
122122
key: mcp-gateway-${{ runner.os }}-${{ inputs.mcp-gateway-version }}
@@ -310,4 +310,8 @@ runs:
310310
echo "::debug::Output file: $OUTPUT_FILE"
311311
fi
312312
313+
echo ""
314+
echo "---"
315+
echo ""
316+
313317
exit $EXIT_CODE

0 commit comments

Comments
 (0)