51 lines
1.8 KiB
Markdown
51 lines
1.8 KiB
Markdown
# Coding Automator Action
|
|
|
|
Send issue comments to the coding agent so it can pick up and work on tasks mentioned with `@bot`.
|
|
|
|
## Quick start
|
|
|
|
```yaml
|
|
name: Send Tasks to Agent
|
|
on:
|
|
issue_comment:
|
|
types: [created, edited]
|
|
|
|
jobs:
|
|
dispatch:
|
|
if: contains(github.event.comment.body, '@bot')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
issues: read
|
|
contents: read
|
|
steps:
|
|
- name: Send task to coding agent
|
|
uses: git.yusufali.ca/automation/action@main
|
|
with:
|
|
api_url: ${{ secrets.AGENT_API_URL }} # default: https://api.servc.io
|
|
api_token: ${{ secrets.AGENT_TOKEN }} # optional, required for authenticated API calls
|
|
bot_route: coder-agent # default: codebot
|
|
debug: false
|
|
env:
|
|
# Used to fetch the first issue comment for context; provided automatically by Actions
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
```
|
|
|
|
## How it works
|
|
|
|
- Trigger on `issue_comment` events that contain `@bot`.
|
|
- The action fetches the **first comment** on the issue (when available) to capture the original task and strips the `@bot` mention. If none exists, it falls back to the triggering comment.
|
|
- It posts the task, repo info, and issue number to the configured agent API route.
|
|
- Agent responses are logged to the workflow output; failures set the step as failed.
|
|
|
|
## Inputs
|
|
|
|
- `api_url` (default `https://api.servc.io`): Agent API endpoint.
|
|
- `api_token` (optional): Token sent as `Apitoken` header for authenticated calls.
|
|
- `bot_route` (default `codebot`): Agent route to target.
|
|
- `debug` (default `false`): When `true`, logs the payload and configuration for troubleshooting.
|
|
|
|
## Notes
|
|
|
|
- Ensure `issues: read` permission so the action can fetch the first comment for context.
|
|
- The action respects `GITHUB_SERVER_URL` for GitHub Enterprise environments.
|