fix: improve logging when checking fork (#1246)

This commit is contained in:
Peter Evans 2022-09-21 10:40:38 +09:00 committed by GitHub
parent 6e59b075e0
commit 171dd555b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

1
dist/index.js vendored
View file

@ -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.`);

View file

@ -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
)