-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.14 KB
/
agent-trigger.yml
File metadata and controls
47 lines (39 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: AgentBox Trigger
on:
# Auto-trigger on issues
issues:
types: [opened, labeled]
# Auto-trigger on PRs
pull_request:
types: [opened, synchronize]
# Auto-trigger on pushes to main
push:
branches: [main, master]
# Trigger when someone @mentions agentbox in a comment
issue_comment:
types: [created]
# Manual trigger with custom prompt
workflow_dispatch:
inputs:
prompt:
description: "What should the agent do?"
required: true
type: string
jobs:
trigger-agent:
runs-on: ubuntu-latest
# Only trigger on comments that mention @agentbox
if: >
github.event_name != 'issue_comment' ||
contains(github.event.comment.body, '@agentbox')
steps:
- name: Trigger AgentBox
run: |
# Send the full GitHub event payload to AgentBox webhook
curl -s -X POST "${{ secrets.AGENTBOX_URL }}/api/webhook" \
-H "Content-Type: application/json" \
-H "X-GitHub-Event: ${{ github.event_name }}" \
-d '${{ toJson(github.event) }}' \
| jq .
env:
AGENTBOX_URL: ${{ secrets.AGENTBOX_URL }}