From ce01de8348d01bfdda6b74dddbc44096f990fade Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Thu, 13 Jun 2024 12:15:23 -0400 Subject: [PATCH] select2 (#11) --- .github/scripts/domain-check.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/scripts/domain-check.js b/.github/scripts/domain-check.js index e316eb5ed..29f0d0f2f 100644 --- a/.github/scripts/domain-check.js +++ b/.github/scripts/domain-check.js @@ -11,20 +11,20 @@ function matchesPattern(domain, filePaths) { } async function prFiles(github, context) { - const pr = context.payload.pull_request; - if (!pr) { - return []; - } const response = await github.rest.pulls.listFiles({ owner: context.repo.owner, repo: context.repo.repo, - pull_number: pr.number + pull_number: context.payload.pull_request.number }); const prFiles = response.data.map(file => file.filename); return prFiles; } module.exports = async ({github, context, domain}) => { + if (!context.payload.pull_request) { + console.log('Not a pull request. Testing all domains.'); + return true; + } const files = await prFiles(github, context); const match = matchesPattern(domain, files); console.log("Domain: ", domain)