From 4f6e6827d1437f18e30306b56f95e2d72b8f5d7e Mon Sep 17 00:00:00 2001 From: Hani Date: Fri, 2 Jun 2023 02:49:07 -0400 Subject: [PATCH] fix `is_same_repo` check --- dist/index.js | 4 ++-- index.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index d3044cf..5bd54cc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -9984,8 +9984,8 @@ function getJSON({ configPath, localConfigPath, remoteConfigURL, GitHubConfigOwn const url = new URL(remoteConfigURL); return yield downloadJSON(url); } - const is_same_repo = GitHubConfigOwner === context.repo.owner && - GitHubConfigRepo === context.repo.repo; + const is_same_repo = (!GitHubConfigOwner || GitHubConfigOwner === context.repo.owner) && + (!GitHubConfigRepo || GitHubConfigRepo === context.repo.repo); core.info(`Using config file ${GitHubConfigPath || configPath} from repo ${GitHubConfigOwner || context.repo.owner}/${GitHubConfigRepo || context.repo.repo} [ref: ${GitHubConfigRef || (is_same_repo ? context.sha : "latest commit on the default branch")}]`); let _octokit = octokit; diff --git a/index.ts b/index.ts index 48d46ae..1916da0 100644 --- a/index.ts +++ b/index.ts @@ -176,8 +176,8 @@ async function getJSON({ } const is_same_repo = - GitHubConfigOwner === context.repo.owner && - GitHubConfigRepo === context.repo.repo; + (!GitHubConfigOwner || GitHubConfigOwner === context.repo.owner) && + (!GitHubConfigRepo || GitHubConfigRepo === context.repo.repo); core.info( `Using config file ${GitHubConfigPath || configPath} from repo ${