Skip to content

Commit

Permalink
updating functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
enyil committed Nov 19, 2021
1 parent 3d44d83 commit d16f8d3
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@ module.exports = (app) => {
// Your code here
app.log.info("Yay, the app was loaded!");

app.on("repository.created", async (context) => {
// app.on("repository.created", async (context) => {

const team_name = "team_name"
// const team_name = "team_name"

context.octokit.teams.addOrUpdateRepoPermissionsInOrg({
org: "github",
team_slug: team_name + "_admin",
repo: repo.name,
permission: "admin"
});

context.octokit.teams.addOrUpdateRepoPermissionsInOrg({
org: "github",
team_slug: team_name + "_read",
repo: repo.name,
permission: "pull"
});
// context.octokit.teams.addOrUpdateRepoPermissionsInOrg({
// org: "github",
// team_slug: team_name + "_admin",
// repo: repo.name,
// permission: "admin"
// });

context.octokit.teams.addOrUpdateRepoPermissionsInOrg({
org: "github",
team_slug: team_name + "_write",
repo: repo.name,
permission: "push"
});
});
// context.octokit.teams.addOrUpdateRepoPermissionsInOrg({
// org: "github",
// team_slug: team_name + "_read",
// repo: repo.name,
// permission: "pull"
// });

// Sample action
// app.on("issues.opened", async (context) => {
// const issueComment = context.issue({
// body: "Thanks for opening this issue!",
// context.octokit.teams.addOrUpdateRepoPermissionsInOrg({
// org: "github",
// team_slug: team_name + "_write",
// repo: repo.name,
// permission: "push"
// });
// return context.octokit.issues.createComment(issueComment);
// });

// Sample action
app.on("issues.opened", async (context) => {
const issueComment = context.issue({
body: "Thanks for opening this issue!",
});
return context.octokit.issues.createComment(issueComment);
});

// For more information on building apps:
// https://probot.github.io/docs/

Expand Down

0 comments on commit d16f8d3

Please sign in to comment.