Integrations / GitHub
GitHub
Code hosting: repositories, issues and pull requests.
8 actions
OAuth 2
6 read2 write
Calls api.github.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "github" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
| Scope | Why it is requested |
|---|---|
repo | Read and write repositories, issues and pull requests |
read:user | Identify the connected GitHub account |
Actions
Comment on issuewritegithub.comment_on_issueAdd a comment to an issue or pull request.
Needs scope: repo
| Input | Type | Description | |
|---|---|---|---|
owner | string | Required | Repository owner (user or org) |
repo | string | Required | Repository name |
issue_number | integer | Required | |
body | string | Required |
await setu.execute({
userId: "user_1",
action: "github.comment_on_issue",
input: {
"owner": "<owner>",
"repo": "<repo>",
"issue_number": 1,
"body": "<body>"
},
});Create issuewritegithub.create_issueCreate a new issue in a repository.
Needs scope: repo
| Input | Type | Description | |
|---|---|---|---|
owner | string | Required | Repository owner (user or org) |
repo | string | Required | Repository name |
title | string | Required | |
body | string | Optional | |
labels | array of string | Optional |
await setu.execute({
userId: "user_1",
action: "github.create_issue",
input: {
"owner": "<owner>",
"repo": "<repo>",
"title": "<title>"
},
});Get pull requestreadgithub.get_prGet a single pull request by number.
Needs scope: repo
| Input | Type | Description | |
|---|---|---|---|
owner | string | Required | Repository owner (user or org) |
repo | string | Required | Repository name |
pull_number | integer | Required |
await setu.execute({
userId: "user_1",
action: "github.get_pr",
input: {
"owner": "<owner>",
"repo": "<repo>",
"pull_number": 1
},
});Get repositoryreadgithub.get_repoGet details of a single repository.
Needs scope: repo
| Input | Type | Description | |
|---|---|---|---|
owner | string | Required | Repository owner (user or org) |
repo | string | Required | Repository name |
await setu.execute({
userId: "user_1",
action: "github.get_repo",
input: {
"owner": "<owner>",
"repo": "<repo>"
},
});List issuesreadgithub.list_issuesList issues in a repository, optionally filtered by state.
Needs scope: repo
| Input | Type | Description | |
|---|---|---|---|
owner | string | Required | Repository owner (user or org) |
repo | string | Required | Repository name |
state | string | Optional | |
per_page | integer | Optional |
await setu.execute({
userId: "user_1",
action: "github.list_issues",
input: {
"owner": "<owner>",
"repo": "<repo>"
},
});List pull requestsreadgithub.list_prsList pull requests in a repository.
Needs scope: repo
| Input | Type | Description | |
|---|---|---|---|
owner | string | Required | Repository owner (user or org) |
repo | string | Required | Repository name |
state | string | Optional | |
per_page | integer | Optional |
await setu.execute({
userId: "user_1",
action: "github.list_prs",
input: {
"owner": "<owner>",
"repo": "<repo>"
},
});List repositoriesreadgithub.list_reposList repositories the connected user can access.
Needs scope: repo
| Input | Type | Description | |
|---|---|---|---|
per_page | integer | Optional | Results per page (max 100) |
sort | string | Optional |
await setu.execute({
userId: "user_1",
action: "github.list_repos",
input: {},
});Search codereadgithub.search_codeSearch code across GitHub using a query string.
Needs scope: repo
| Input | Type | Description | |
|---|---|---|---|
q | string | Required | GitHub code search query |
per_page | integer | Optional |
await setu.execute({
userId: "user_1",
action: "github.search_code",
input: {
"q": "<q>"
},
});