Created
March 6, 2020 02:50
-
-
Save luciovilla/50bfd3d13b99be450f7f30e195b9a881 to your computer and use it in GitHub Desktop.
adding github team to org repo in node with octokit js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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