---
title: "GitHub"
sidebarTitle: "GitHub"
description: "Here are some example workflows you could create using the GitHub integration."
---


To use the GitHub integration you must first install the required packages:

<Tabs>
  <Tab title="npm">

```bash
npm install @trigger.dev/github
```

  </Tab>
  <Tab title="pnpm">

```bash
pnpm install @trigger.dev/github
```

  </Tab>
  <Tab title="yarn">

```bash
yarn add @trigger.dev/github
```

  </Tab>
</Tabs>

You can explore all the supported GitHub functions [here](/integrations/apis/github/events/push).


## When a GitHub repo is starred, post information about the user to Slack

Integrations required: GitHub, Slack

```ts
import { Trigger } from "@trigger.dev/sdk";
import * as github from "@trigger.dev/github";
import * as slack from "@trigger.dev/slack";

new Trigger({
  id: "new-github-star-to-slack",
  name: "New GitHub Star: triggerdotdev/trigger.dev",
  apiKey: "<my_api_key>",
  on: github.events.newStarEvent({
    repo: "triggerdotdev/trigger.dev",
  }),
  run: async (event) => {
    await slack.postMessage("github-stars", {
      channelName: "github-stars",
      text: `New GitHub star from \n<${event.sender.html_url}|${event.sender.login}>`,
    });
  },
}).listen();
```

## When a GitHub issue is created or modified, post to Slack

Integrations required: GitHub, Slack

```ts
import { Trigger } from "@trigger.dev/sdk";
import * as github from "@trigger.dev/github";
import * as slack from "@trigger.dev/slack";

new Trigger({
  id: "my-workflow-1",
  name: "Posts to Slack when GitHub Issue created or modified",
  apiKey: "<my_api_key>",
  on: github.events.issueEvent({
    repo: "my-github-org/my-github-repo",
  }),

  run: async (event, ctx) => {
    const response = await slack.postMessage("send-to-slack", {
      channelName: "my-slack-channel-name",
      text: `A new issue has been created or modified. ${event.action}`,
    });

    return response.message;
  },
}).listen();
```

You can explore all the supported GitHub functions [here](/integrations/apis/github/events/push).
