Skip to content

Commit 925837b

Browse files
committed
refactor(stage-override): change return type to string and update output handling
1 parent 7af26f3 commit 925837b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

packages/branch-utilities/src/scripts/stage-override-to-pr-base.function.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface StageOverrideToPrBaseOptions {
66

77
export async function stageOverrideToPrBase(
88
options: StageOverrideToPrBaseOptions | Promise<StageOverrideToPrBaseOptions>,
9-
): Promise<void> {
9+
): Promise<string> {
1010
const opts = await options
1111

1212
const gitHubPrJson = execReturn('gh pr list --json headRefName,title,isDraft,closed')
@@ -15,9 +15,8 @@ export async function stageOverrideToPrBase(
1515
const branchNameOverride = opts.branchNameOverride || process.env['GITHUB_BASE_REF']
1616
const isPrOverride = !!gitHubPrs.find((pr: any) => pr.headRefName === branchNameOverride)
1717

18-
// export to env
19-
process.stdout.write(`
18+
return `
2019
export SC_OVERRIDE_BRANCH_NAME=${branchNameOverride}
2120
export SC_OVERRIDE_IS_PR=${isPrOverride}
22-
`)
21+
`
2322
}

0 commit comments

Comments
 (0)