From c446ac216b015582773f0d8e0e0e8fb4e4159547 Mon Sep 17 00:00:00 2001 From: Reinier Guerra Date: Mon, 22 Feb 2021 18:52:26 -0500 Subject: [PATCH] fix: labels creation when install --- api/policies/isGithubAuth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/policies/isGithubAuth.js b/api/policies/isGithubAuth.js index 6430b32..c8fdbd8 100644 --- a/api/policies/isGithubAuth.js +++ b/api/policies/isGithubAuth.js @@ -31,12 +31,12 @@ function shouldUsePersonalToken(fullName) { } module.exports = async function isGithubAuth(req, res, next) { - const { installation, repository, repositories } = req.body; + const { installation, repository, repositories_added } = req.body; const app = new App({ id: github.appId, privateKey: cert }); - const repositoryName = (repositories && repositories[0] && repositories[0].full_name) ? repositories[0].full_name : repository.full_name; + const repositoryName = (repositories_added && repositories_added[0] && repositories_added[0].full_name) ? repositories_added[0].full_name : repository.full_name; // pretier-ignore const octokitClient = (repository && shouldUsePersonalToken(repositoryName)) ? new Octokit({ auth: process.env.PERSONAL_ACCESS_TOKEN })