Changefile from PR description: Fix community PRs from branch named trunk (#39306)

* check if remote branch is trunk before checking out

* fix comment
This commit is contained in:
Paul Sealock 2023-07-21 08:50:01 +12:00 committed by GitHub
parent bfedd049c1
commit d95554126f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -91,8 +91,11 @@ const program = new Command( 'changefile' )
`Temporary clone of '${ headOwner }/${ name }' created at ${ tmpRepoPath }`
);
Logger.notice( `Checking out remote branch ${ branch }` );
await checkoutRemoteBranch( tmpRepoPath, branch );
// If a pull request is coming from a contributor's fork's trunk branch, we don't nee to checkout the remote branch because its already available as part of the clone.
if ( branch !== 'trunk' ) {
Logger.notice( `Checking out remote branch ${ branch }` );
await checkoutRemoteBranch( tmpRepoPath, branch );
}
Logger.notice(
`Getting all touched projects requiring a changelog`