Before you start
- The Guild CLI, logged in.
- Slack connected in your workspace, and the Slack agent invited to the channel it will post in. See Slack setup.
- A GitHub repository where you can add Actions workflows and secrets.
1. Create the agent
PROMPT.md:
guild.yaml:
2. Save it and install it in your workspace
3. Create the API trigger
API triggers and their keys are created in the web UI:- Open the workspace, click Triggers, then Add Trigger.
- Select API, choose
<your-name>~release-notes, and name it, for exampleRelease notes from CI. - Copy the credentials string,
<api_key_id>:<api_key_secret>. It’s shown only once.
GUILD_TRIGGER_KEY. The key can read and post to every session in the workspace, so keep it out of logs and code.
4. Add the workflow
Add.github/workflows/release-notes.yml, with your Guild workspace’s owner and name and the Slack channel ID filled in:
fetch-depth: 0 fetches the history and tags that git describe needs. On the first tag there’s no previous one, so the job lists every commit up to it. shell: bash turns on pipefail, so a failed request fails the step instead of passing null along.
A Native agent takes text, so agent_input is {"text": ...}. jq builds the body so quotes and newlines in commit messages stay valid JSON.
5. Try it
Push a tag:Variations
-
Fail the job when the run errors. Save the session ID instead of printing the URL (
session=$(curl ... | jq -r .id)), then poll session status untilroot_task.statusisDONE,ERRORorINTERRUPTED:WAITINGisn’t terminal: the task waits there on sub-agents or hooks. A failed Slack post doesn’t make the run fail: the agent sees the tool’s error and can still finishDONE. To catch that too, tell the agent to say in its final answer whether the post succeeded, and read it from the session events. - Run it after a deploy instead. Call the same endpoint from your deploy job, with the commits between the previous and the new deployed SHA.
-
Use one trigger for several agents. Add
"agent_id": "<owner>~<agent>"to the body to run another agent installed in the workspace with the same key.agent_inputmust then match that agent’s input.
Related
- API triggers: keys, follow-up messages, status and events
- Slack integration: posting messages and scopes
- Native agents: what a prompt-only agent can and can’t do