Skip to content

Commit

Permalink
fix: improve logging when checking fork (peter-evans#1246)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans authored and aleksandrychev committed Mar 4, 2024
1 parent ff493e4 commit 84664f9
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
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
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 84664f9

Please sign in to comment.