34 lines
880 B
Plaintext
34 lines
880 B
Plaintext
---
|
|
title: "GitHub"
|
|
sidebarTitle: "GitHub"
|
|
description: "Here are some example workflows you could create using the GitHub integration."
|
|
---
|
|
|
|
## When a GitHub issue is created or modified, post to Slack
|
|
|
|
Integrations required: GitHub, Slack
|
|
|
|
```ts
|
|
import { github, slack } from "@trigger.dev/integrations";
|
|
import { Trigger } from "@trigger.dev/sdk";
|
|
|
|
new Trigger({
|
|
id: "new-github-star-to-slack",
|
|
name: "New GitHub Star",
|
|
apiKey: "<your_api_key>",
|
|
logLevel: "debug",
|
|
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();
|
|
```
|
|
|
|
You can explore all the supported GitHub functions [here](/integrations/apis/github/events/push).
|