Subscribe to webhooks and automate tasks in your code repositories.

Using our official GitHub integration

  • Easily subscribe to GitHub webhooks to trigger your jobs.

  • Create any tasks possible with the GitHub API.

  • Use io.runTask() and the official SDK or fetch.

  • Example code using GitHub

    Below are some working code examples of how you can use GitHub with Trigger.dev. These samples are open source and maintained by the community, you can copy and paste them into your own projects.

    import { TriggerClient } from "@trigger.dev/sdk";
    import { Github, events } from "@trigger.dev/github";
    import { Slack } from "@trigger.dev/slack";
    const github = new Github({ id: "github" });
    const slack = new Slack({ id: "slack" });
    // This Job will run when a star is added or removed from the triggerdotdev/trigger.dev repo
    client.defineJob({
    id: "github-new-star-to-slack",
    name: "GitHub: new star to slack",
    version: "1.0.0",
    trigger: github.triggers.repo({
    event: events.onStar,
    owner: "<your-org-name>",
    repo: "<your-repo-name>",
    }),
    integrations: {
    slack,
    },
    run: async (payload, io, ctx) => {
    await io.slack.postMessage("post message", {
    channel: process.env.SLACK_CHANNEL_ID!,
    text: `New GitHub star from ${payload.sender.html_url}, ${payload.sender.name}. Your new GitHub star count is ${payload.repository.stargazers_count}.`,
    });
    },
    });

    Full-stack GitHub example projects

    ,