GitHub Issues
Auto-spawn agents from GitHub issue events — labels, assignments, and state changes.
How it works
A GitHub Issues workflow watches webhook events from your repositories. When an issue matches your trigger conditions, ElasticClaw creates an agent pre-loaded with the issue context. The agent implements the fix/feature, opens a PR, and signals done with [DONE].
Trigger conditions:
- Issue state changes to
open(or a configured label is applied) - All configured
labelsare present on the issue (AND) assigned_tofilter matches (if configured)
This page assumes you already have a workspace, such as my-app. Add the issue tracker to that workspace, then publish workflow YAML into it.
1. Configure the issue tracker
Settings -> Workspaces -> my-app -> Issue Trackers
Add GitHub Issues:
token: ghp_xxxxxxxxxxxxx
webhook secret: generated by ElasticClaw ServerThe token needs repo scope for private repos or public_repofor public repos. The webhook secret is stored in the selected workspace and validates incoming webhooks via HMAC-SHA256.
2. Set up the webhook
In your GitHub repository settings:
- Go to Settings → Webhooks → Add webhook
- Payload URL:
https://server.example.com/api/workspaces/my-app/webhooks/github-issues - Content type:
application/json - Secret: your webhook secret
- Events: Issues
3. Create a workflow
Create a workflow YAML file for your repository, labels, and lifecycle stages:
# .elasticclaw/workflows/bugfix-bot.yaml
schema_version: v1
name: bugfix-bot
trigger:
github_issues:
event: issue_labeled
repositories:
- my-org/my-app
states:
- open
labels:
- agent-ready
labelers:
- "*"
stages:
- id: working
label: Working
entry: true
on_enter:
remove_labels: [agent-ready]
add_labels: [agent-working]
inject: |
Issue: {{.Issue.Identifier}} — {{.Issue.Title}}
URL: {{.Issue.URL}}
Read CONTEXT.md and start working.
- id: pr_opened
label: PR Opened
triggers:
- message_contains: "[DONE]"
on_enter:
add_labels: [in-review]
remove_labels: [agent-working]
- id: merged
label: Merged
triggers:
- pr_merged: {}
terminal: truestages to add and remove labels, inject messages, and terminate when the tracked PR merges.4. Push the workflow
elasticclaw workflow push --workspace my-app .elasticclaw/workflows/bugfix-bot.yamlTemplate variables
In stages[].on_enter.inject, automatic GitHub Issues workflows expose this complete issue object:
{{.Issue.Identifier}} — Issue number as #42.
{{.Issue.Title}} — GitHub issue title.
{{.Issue.URL}} — Browser URL for the issue.
{{.Issue.Description}} — GitHub issue body.
Filters
Labels
All configured labels must be present on the issue. The trigger also fires when a label is added to an already-open issue (if the label completes the set).
AssignedTo
Filter by assignee:
@username— only this user!@username— exclude this userany— must have an assigneenone— must be unassigned
Context file
When an agent is created, ElasticClaw Server writes a CONTEXT.md file containing the issue title, description, labels, author, and instructions. The agent reads this on startup to understand its task.
[DONE]and terminates when the PR merges or closes.