GitHub
React to repository events and interact with issues, PRs, and comments.
Triggers
GitHub triggers support two modes: polling (default, uses gh CLI) and webhook (requires public URL).
# Push trigger - react to commits
trigger:
type: github.push
with:
repo: owner/repo
branch: main # Optional: filter by branch
mode: polling # Default - uses gh CLI locally
pollInterval: 60 # Poll every 60 seconds
# Pull request trigger
trigger:
type: github.pull_request
with:
repo: owner/repo
events: [opened, synchronize]
# Issue triggers
trigger:
type: github.issue.opened
with:
repo: owner/repo
trigger:
type: github.issue.labeled
with:
repo: owner/repo
label: bug # Optional: filter by label
Trigger Data
GitHub triggers provide rich data you can use in your workflow steps:
Pull Request Trigger Data
# Convenience fields (top-level)
{{ trigger.title }} # PR title
{{ trigger.body }} # PR description
{{ trigger.author }} # PR author username
{{ trigger.url }} # PR URL
{{ trigger.number }} # PR number
{{ trigger.action }} # Event action (opened, synchronize, closed)
{{ trigger.repository }} # Repository name (owner/repo)
# Files changed
{{ trigger.fileNames }} # Array of changed file paths
{{ trigger.files }} # Array of file objects with details
# Full PR object
{{ trigger.pullRequest.title }}
{{ trigger.pullRequest.body }}
{{ trigger.pullRequest.state }}
{{ trigger.pullRequest.head.ref }} # Source branch
{{ trigger.pullRequest.base.ref }} # Target branch
{{ trigger.pullRequest.additions }} # Lines added
{{ trigger.pullRequest.deletions }} # Lines deleted
{{ trigger.pullRequest.labels }} # Array of label names
{{ trigger.pullRequest.draft }} # Is draft PR
Issue Trigger Data
# Convenience fields (top-level)
{{ trigger.title }} # Issue title
{{ trigger.body }} # Issue body
{{ trigger.author }} # Issue author username
{{ trigger.url }} # Issue URL
{{ trigger.number }} # Issue number
# Full issue object
{{ trigger.issue.title }}
{{ trigger.issue.body }}
{{ trigger.issue.state }}
{{ trigger.issue.labels }} # Array of label names
{{ trigger.issue.assignees }} # Array of assignee usernames
{{ trigger.issue.comments }} # Comment count
Actions
# Create an issue
- id: create-issue
action: github.create_issue
with:
repo: owner/repo
title: "New issue from workflow"
body: "Created by Weavr"
labels: [automated, triage]
# Add a comment
- id: comment
action: github.create_comment
with:
repo: owner/repo
issue_number: "{{ trigger.issue.number }}"
body: "Thanks for reporting!"
# Create a pull request
- id: create-pr
action: github.create_pr
with:
repo: owner/repo
title: "Automated changes"
head: feature-branch
base: main
Local development: Polling mode uses the gh CLI, so you need to have it installed and authenticated (gh auth login).
Telegram
Send messages and receive updates from Telegram bots.
Setup
- Create a bot via @BotFather
- Set TELEGRAM_BOT_TOKEN environment variable or add to config
Trigger
trigger:
type: telegram.message
with:
chatId: 123456789 # Optional: filter by chat
chatType: private # Optional: private, group, supergroup, channel
Actions
# Send a message
- id: notify
action: telegram.send
with:
chatId: "{{ trigger.chatId }}"
text: "Hello from Weavr!"
parseMode: HTML # Optional: HTML, Markdown, MarkdownV2
# Send a photo
- id: send-photo
action: telegram.sendPhoto
with:
chatId: 123456789
photo: "https://example.com/image.png"
caption: "Check this out"
Slack
Post messages to Slack channels and respond to events.
Setup
Set SLACK_BOT_TOKEN or SLACK_WEBHOOK_URL.
Actions
# Post to channel
- id: notify
action: slack.post
with:
channel: "#general"
text: "Deployment complete!"
# Post with blocks
- id: rich-message
action: slack.post
with:
channel: "#alerts"
blocks:
- type: section
text:
type: mrkdwn
text: "*Alert:* Service degradation detected"
Discord
Send messages to Discord channels via webhooks.
- id: notify
action: discord.send
with:
webhookUrl: "{{ env.DISCORD_WEBHOOK }}"
content: "Build completed successfully!"
username: "Weavr Bot"
Linear
Create and manage Linear issues from workflows.
Setup
Set LINEAR_API_KEY environment variable.
# Create an issue
- id: create-issue
action: linear.create_issue
with:
teamId: "TEAM-123"
title: "Bug from production"
description: "{{ trigger.error.message }}"
priority: 2 # 0=none, 1=urgent, 2=high, 3=medium, 4=low
HTTP / Webhooks
Make HTTP requests and receive webhook events.
Webhook Trigger
trigger:
type: http.webhook
with:
path: /my-webhook # Available at /webhook/my-webhook
HTTP Request Action
- id: api-call
action: http.request
with:
url: "https://api.example.com/data"
method: POST
headers:
Authorization: "Bearer {{ env.API_TOKEN }}"
Content-Type: application/json
body:
key: value
Send emails via SMTP.
Setup
Configure SMTP in ~/.weavr/config.yaml:
email:
smtp:
host: smtp.example.com
port: 587
secure: true
auth:
user: your-email@example.com
pass: your-password
Send Email
- id: send-email
action: email.send
with:
to: recipient@example.com
subject: "Workflow Complete"
body: "Your workflow finished successfully."
Cron Schedules
Run workflows on a schedule.
trigger:
type: cron.schedule
with:
expression: "0 9 * * *" # Every day at 9 AM
timezone: America/New_York # Optional, defaults to system timezone
# Common patterns:
# "*/15 * * * *" - Every 15 minutes
# "0 * * * *" - Every hour
# "0 9 * * 1-5" - 9 AM on weekdays
# "0 0 1 * *" - First day of each month