Skip to content

Commit 53d47e6

Browse files
authored
Merge pull request #1 from derekmisler/action-optimizations
action optimizations
2 parents ca24473 + 4071931 commit 53d47e6

File tree

2 files changed

+267
-46
lines changed

2 files changed

+267
-46
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

0 commit comments

Comments
 (0)