Skip to content

Instantly share code, notes, and snippets.

@luciovilla
Created March 6, 2020 02:50
Show Gist options
  • Save luciovilla/50bfd3d13b99be450f7f30e195b9a881 to your computer and use it in GitHub Desktop.
Save luciovilla/50bfd3d13b99be450f7f30e195b9a881 to your computer and use it in GitHub Desktop.
adding github team to org repo in node with octokit js
#!/usr/bin/node
const { Octokit } = require('@octokit/rest')
const octokit = new Octokit({
auth: AUTH_TOKEN,
})
const addTeam2Repo = async () => {
try {
await octokit.teams.addOrUpdateRepoInOrg({
team_slug: 'GITHUB TEAM SLUG',
owner: 'GITHUB ORG NAME',
org: 'GITHUB ORG NAME',
repo: 'REPO NAME',
permission: 'admin',
})
} catch (e) {
console.log(e)
}
}
addTeam2Repo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment