diff --git a/scripts/lib/gitUtils.ts b/scripts/lib/gitUtils.ts index bc31baace0..5742dde18e 100644 --- a/scripts/lib/gitUtils.ts +++ b/scripts/lib/gitUtils.ts @@ -66,10 +66,11 @@ export async function createGitHubRelease({ version, body }: GitHubReleaseParams }) } -export function createPullRequest(mainBranch: string) { +export function createPullRequest(mainBranch: string, labels?: string[]) { using token = getGithubPullRequestToken() command`gh auth login --with-token`.withInput(token.value).run() - const pullRequestUrl = command`gh pr create --fill --base ${mainBranch}`.run() + const labelArgs = labels?.flatMap((label) => ['--label', label]) ?? [] + const pullRequestUrl = command`gh pr create --fill --base ${mainBranch} ${labelArgs}`.run() return pullRequestUrl.trim() } diff --git a/scripts/test/bump-chrome-version.ts b/scripts/test/bump-chrome-version.ts index a916202999..b4f38573ab 100644 --- a/scripts/test/bump-chrome-version.ts +++ b/scripts/test/bump-chrome-version.ts @@ -55,7 +55,7 @@ runMain(async () => { printLog('Create PR...') - const pullRequestUrl = createPullRequest(MAIN_BRANCH) + const pullRequestUrl = createPullRequest(MAIN_BRANCH, ['dependencies']) printLog(`Chrome version bump PR created (from ${CURRENT_PACKAGE_VERSION} to ${packageVersion}).`) // used to share the pull request url to the notification jobs