Skip to content

Commit

Permalink
lookup-pr no results is non-fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
mshick committed Mar 21, 2023
1 parent f40300f commit 86db556
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/commands/__tests__/promoteBranch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('promoteBranch', () => {
await promoteBranch({ productionOnly: false, lookupPr: true })

expect(log.debug).toHaveBeenCalledWith(`Using lookupPr`, commitInfo)
expect(log.error).toHaveBeenCalledWith(`Could not find an associated pull request branch`)
expect(log.info).toHaveBeenCalledWith(`No associated pull request branch found`)
})

it('looks up a pr and uses the head ref as the branchName and then promotes it', async () => {
Expand Down
3 changes: 2 additions & 1 deletion src/commands/promoteBranch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export async function handler({ name, lookupPr, nofail, productionOnly, ...flags
)

if (!headRef) {
throw new Error('Could not find an associated pull request branch')
log.info('No associated pull request branch found')
return
}

branchName = headRef
Expand Down

0 comments on commit 86db556

Please sign in to comment.