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 labels are present on the issue (AND)
  • assigned_to filter 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

text
Settings -> Workspaces -> my-app -> Issue Trackers
Add GitHub Issues:
  token: ghp_xxxxxxxxxxxxx
  webhook secret: generated by ElasticClaw Server

The 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:

  1. Go to Settings → Webhooks → Add webhook
  2. Payload URL: https://server.example.com/api/workspaces/my-app/webhooks/github-issues
  3. Content type: application/json
  4. Secret: your webhook secret
  5. Events: Issues

3. Create a workflow

Create a workflow YAML file for your repository, labels, and lifecycle stages:

yaml
# .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: true
GitHub Issues workflows can use stages to add and remove labels, inject messages, and terminate when the tracked PR merges.

4. Push the workflow

bash
elasticclaw workflow push --workspace my-app .elasticclaw/workflows/bugfix-bot.yaml

Template 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 user
  • any — must have an assignee
  • none — 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.

GitHub Issues workflows support the same stages as Linear/Shortcut workflows. The default workflow can move the issue on [DONE]and terminates when the PR merges or closes.