Back to Autogpt

GitHub Triggers

docs/integrations/block-integrations/github/triggers.md

0.6.4410.7 KB
Original Source

GitHub Triggers

<!-- MANUAL: file_description -->

Blocks for triggering workflows from GitHub webhook events like pull requests, issues, releases, and stars.

<!-- END MANUAL -->

Github Discussion Trigger

What it is

This block triggers on GitHub Discussions events. Great for syncing Q&A to Discord or auto-responding to common questions. Note: Discussions must be enabled on the repository.

How it works

<!-- MANUAL: how_it_works -->

This block creates a webhook subscription to GitHub Discussions events using the GitHub Webhooks API. When a discussion event occurs (created, edited, answered, etc.), GitHub sends a webhook payload that triggers your workflow.

The block parses the webhook payload and extracts discussion details including the title, body, category, state, and the user who triggered the event. Note that GitHub Discussions must be enabled on the repository.

<!-- END MANUAL -->

Inputs

InputDescriptionTypeRequired
repoRepository to subscribe to. Note: Make sure your GitHub credentials have permissions to create webhooks on this repo.strYes
eventsThe discussion events to subscribe toEventsYes

Outputs

OutputDescriptionType
errorError message if the payload could not be processedstr
payloadThe complete webhook payload that was received from GitHub. Includes information about the affected resource (e.g. pull request), the event, and the user who triggered the event.Dict[str, Any]
triggered_by_userObject representing the GitHub user who triggered the eventDict[str, Any]
eventThe discussion event that triggered the webhookstr
numberThe discussion numberint
discussionThe full discussion objectDict[str, Any]
discussion_urlURL to the discussionstr
titleThe discussion titlestr
bodyThe discussion bodystr
categoryThe discussion category objectDict[str, Any]
category_nameName of the categorystr
stateDiscussion statestr

Possible use case

<!-- MANUAL: use_case -->

Discord Sync: Post new discussions to Discord channels to keep the community engaged across platforms.

Auto-Responder: Automatically respond to common questions in discussions with helpful resources.

Q&A Routing: Route discussion questions to the appropriate team members based on category or content.

<!-- END MANUAL -->

Github Issues Trigger

What it is

This block triggers on GitHub issues events. Useful for automated triage, notifications, and welcoming first-time contributors.

How it works

<!-- MANUAL: how_it_works -->

This block creates a webhook subscription to GitHub Issues events. When an issue event occurs (opened, closed, labeled, assigned, etc.), GitHub sends a webhook payload that triggers your workflow.

The block extracts issue details including the title, body, labels, assignees, state, and the user who triggered the event. Use this for automated triage, notifications, and issue management workflows.

<!-- END MANUAL -->

Inputs

InputDescriptionTypeRequired
repoRepository to subscribe to. Note: Make sure your GitHub credentials have permissions to create webhooks on this repo.strYes
eventsThe issue events to subscribe toEventsYes

Outputs

OutputDescriptionType
errorError message if the payload could not be processedstr
payloadThe complete webhook payload that was received from GitHub. Includes information about the affected resource (e.g. pull request), the event, and the user who triggered the event.Dict[str, Any]
triggered_by_userObject representing the GitHub user who triggered the eventDict[str, Any]
eventThe issue event that triggered the webhook (e.g., 'opened')str
numberThe issue numberint
issueThe full issue objectDict[str, Any]
issue_urlURL to the issuestr
issue_titleThe issue titlestr
issue_bodyThe issue body/descriptionstr
labelsList of labels on the issueList[Any]
assigneesList of assigneesList[Any]
stateIssue state ('open' or 'closed')str

Possible use case

<!-- MANUAL: use_case -->

Automated Triage: Automatically label new issues based on keywords in title or description.

Welcome Messages: Send welcome messages to first-time contributors when they open their first issue.

Slack Notifications: Post notifications to Slack when issues are opened or closed.

<!-- END MANUAL -->

Github Pull Request Trigger

What it is

This block triggers on pull request events and outputs the event type and payload.

How it works

<!-- MANUAL: how_it_works -->

This block creates a webhook subscription to GitHub Pull Request events. When a PR event occurs (opened, closed, merged, review requested, etc.), GitHub sends a webhook payload that triggers your workflow.

The block extracts PR details including the number, URL, and full pull request object. This enables automated code review, CI/CD pipelines, and notification workflows.

<!-- END MANUAL -->

Inputs

InputDescriptionTypeRequired
repoRepository to subscribe to. Note: Make sure your GitHub credentials have permissions to create webhooks on this repo.strYes
eventsThe events to subscribe toEventsYes

Outputs

OutputDescriptionType
errorError message if the payload could not be processedstr
payloadThe complete webhook payload that was received from GitHub. Includes information about the affected resource (e.g. pull request), the event, and the user who triggered the event.Dict[str, Any]
triggered_by_userObject representing the GitHub user who triggered the eventDict[str, Any]
eventThe PR event that triggered the webhook (e.g. 'opened')str
numberThe number of the affected pull requestint
pull_requestObject representing the affected pull requestDict[str, Any]
pull_request_urlThe URL of the affected pull requeststr

Possible use case

<!-- MANUAL: use_case -->

Automated Code Review: Trigger AI-powered code review when new PRs are opened.

CI/CD Automation: Start builds and tests when PRs are created or updated.

Reviewer Assignment: Automatically assign reviewers based on files changed or PR author.

<!-- END MANUAL -->

Github Release Trigger

What it is

This block triggers on GitHub release events. Perfect for automating announcements to Discord, Twitter, or other platforms.

How it works

<!-- MANUAL: how_it_works -->

This block creates a webhook subscription to GitHub Release events. When a release event occurs (published, created, edited, etc.), GitHub sends a webhook payload that triggers your workflow.

The block extracts release details including tag name, release name, release notes, prerelease flag, and associated assets. Use this to automate announcements and deployment workflows.

<!-- END MANUAL -->

Inputs

InputDescriptionTypeRequired
repoRepository to subscribe to. Note: Make sure your GitHub credentials have permissions to create webhooks on this repo.strYes
eventsThe release events to subscribe toEventsYes

Outputs

OutputDescriptionType
errorError message if the payload could not be processedstr
payloadThe complete webhook payload that was received from GitHub. Includes information about the affected resource (e.g. pull request), the event, and the user who triggered the event.Dict[str, Any]
triggered_by_userObject representing the GitHub user who triggered the eventDict[str, Any]
eventThe release event that triggered the webhook (e.g., 'published')str
releaseThe full release objectDict[str, Any]
release_urlURL to the release pagestr
tag_nameThe release tag name (e.g., 'v1.0.0')str
release_nameHuman-readable release namestr
bodyRelease notes/descriptionstr
prereleaseWhether this is a prereleasebool
draftWhether this is a draft releasebool
assetsList of release assets/filesList[Any]

Possible use case

<!-- MANUAL: use_case -->

Release Announcements: Post release announcements to Discord, Twitter, or Slack when new versions are published.

Changelog Distribution: Automatically send release notes to mailing lists or documentation sites.

Deployment Triggers: Initiate deployment workflows when releases are published.

<!-- END MANUAL -->

Github Star Trigger

What it is

This block triggers on GitHub star events. Useful for celebrating milestones (e.g., 1k, 10k stars) or tracking engagement.

How it works

<!-- MANUAL: how_it_works -->

This block creates a webhook subscription to GitHub Star events. When someone stars or unstars your repository, GitHub sends a webhook payload that triggers your workflow.

The block extracts star details including the timestamp, current star count, repository name, and the user who starred. Use this to track engagement and celebrate milestones.

<!-- END MANUAL -->

Inputs

InputDescriptionTypeRequired
repoRepository to subscribe to. Note: Make sure your GitHub credentials have permissions to create webhooks on this repo.strYes
eventsThe star events to subscribe toEventsYes

Outputs

OutputDescriptionType
errorError message if the payload could not be processedstr
payloadThe complete webhook payload that was received from GitHub. Includes information about the affected resource (e.g. pull request), the event, and the user who triggered the event.Dict[str, Any]
triggered_by_userObject representing the GitHub user who triggered the eventDict[str, Any]
eventThe star event that triggered the webhook ('created' or 'deleted')str
starred_atISO timestamp when the repo was starred (empty if deleted)str
stargazers_countCurrent number of stars on the repositoryint
repository_nameFull name of the repository (owner/repo)str
repository_urlURL to the repositorystr

Possible use case

<!-- MANUAL: use_case -->

Milestone Celebrations: Announce when your repository reaches star milestones (100, 1k, 10k stars).

Engagement Tracking: Log star events to track repository popularity over time.

Thank You Messages: Send personalized thank you messages to users who star your repository.

<!-- END MANUAL -->