Skip to content

Commit

Permalink
fix is_same_repo check
Browse files Browse the repository at this point in the history
  • Loading branch information
thehanimo committed Jun 2, 2023
1 parent cb5c41d commit 4f6e682
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ${
Expand Down

0 comments on commit 4f6e682

Please sign in to comment.