From 55d7673caeed709fe07f15677daaf4c2f28088ff Mon Sep 17 00:00:00 2001 From: Marick van Tuil Date: Tue, 13 Feb 2024 18:42:45 +0100 Subject: [PATCH] Skip access check for maintainers --- .github/workflows/run-tests.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 60ca914..404a31c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -20,6 +20,17 @@ jobs: return } + // If the user that pushed the commit is a maintainer, skip the check + const collaborators = await github.rest.repos.listCollaborators({ + owner: context.repo.owner, + repo: context.repo.repo + }); + + if (collaborators.data.some(c => c.login === context.actor)) { + console.log(`User ${context.actor} is allowed to run tests because they are a collaborator.`); + return + } + const issue_number = context.issue.number; const repository = context.repo.repo; const owner = context.repo.owner;