From b2313e2329eb43bd1ffbd6523bcfba6acf841282 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jan 2022 12:57:25 +0100 Subject: [PATCH 1/2] chore: pull.user not pull.author Signed-off-by: blam --- scripts/goalie-labels.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/goalie-labels.js b/scripts/goalie-labels.js index 731bd7819a..a6f9202713 100644 --- a/scripts/goalie-labels.js +++ b/scripts/goalie-labels.js @@ -102,7 +102,7 @@ module.exports = async ({ github, context, core }) => { // if the last event for the issue is not by the author, remove the label if ( recentEventsForPR[recentEventsForPR.length - 1].actor.login !== - pullRequest.author.login + pullRequest.user.login ) { await github.rest.issues .removeLabel({ From a56f3fdbb20b2e68946cfe3b0d70a703f602f0fc Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 19 Jan 2022 13:00:43 +0100 Subject: [PATCH 2/2] docs: updating some documentation for the workflows Signed-off-by: blam --- scripts/goalie-labels.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/goalie-labels.js b/scripts/goalie-labels.js index a6f9202713..99f3f92ff4 100644 --- a/scripts/goalie-labels.js +++ b/scripts/goalie-labels.js @@ -42,10 +42,11 @@ module.exports = async ({ github, context, core }) => { const codeowners = new Codeowners(); for (const pullRequest of allPullRequests) { - // Go through each file changed and go through each codeowner entry and use minimatch to see if the file matches - // strip the backstage group from the name? + // Go through each file changed and get the codeowners for that file. + // Find the group in the group list that matches the codeowner. // If it does match push the owner to a list of reviewers - // check to see the reviews and if there is at least one matching reviewer from those groupx + // check to see the reviews and if there is at least one matching reviewer from those group + const changedFiles = await github.paginate(github.rest.pulls.listFiles, { owner: context.repo.owner, repo: context.repo.repo,