Skip to content

Commit

Permalink
fix: improve logging when checking fork (#1246)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans authored Sep 21, 2022
1 parent 6e59b07 commit 171dd55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ function createPullRequest(inputs) {
: baseRemote.repository;
if (inputs.pushToFork) {
// Check if the supplied fork is really a fork of the base
core.info(`Checking if '${branchRepository}' is a fork of '${baseRemote.repository}'`);
const parentRepository = yield githubHelper.getRepositoryParent(branchRepository);
if (parentRepository != baseRemote.repository) {
throw new Error(`Repository '${branchRepository}' is not a fork of '${baseRemote.repository}'. Unable to continue.`);
Expand Down
3 changes: 3 additions & 0 deletions src/create-pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
: baseRemote.repository
if (inputs.pushToFork) {
// Check if the supplied fork is really a fork of the base
core.info(
`Checking if '${branchRepository}' is a fork of '${baseRemote.repository}'`
)
const parentRepository = await githubHelper.getRepositoryParent(
branchRepository
)
Expand Down

0 comments on commit 171dd55

Please sign in to comment.