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";
    const github = new Github({ id: "github" });
    // This Job will run when a new issue is opened on a repo you have admin rights to
    // Once created, it will add a 'Bug' label to the issue
    client.defineJob({
    id: "github-new-issue-opened",
    name: "GitHub: new issue opened",
    version: "1.0.0",
    integrations: { github: github },
    trigger: github.triggers.repo({
    event: events.onIssueOpened,
    owner: "<your-org-name>",
    repo: "<your-repo-name>",
    }),
    run: async (payload, io, ctx) => {
    await io.github.addIssueLabels("add label", {
    owner: payload.repository.owner.login,
    repo: payload.repository.name,
    issueNumber: payload.issue.number,
    labels: ["bug"],
    });
    return { payload, ctx };
    },
    });

    Full-stack GitHub example projects

    ,