Skip to content

Commit

Permalink
fix: remove whitespace from title when there's no suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorhugods committed Sep 20, 2024
1 parent ddc86d8 commit 064d582
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function run(): Promise<void> {
const targetBranch = core.getInput('target-branch')
const submodulesTargetBranch = core.getInput('submodules-target-branch')
const githubToken = core.getInput('pr-creator-token')
const prTitleSuffix = core.getInput('pr-title-suffix')
const prTitleSuffix = core.getInput('pr-title-suffix').trim()
let prAssignee = core.getInput('pr-assignee')
if (prAssignee === '' && mergedPR.assignee != null) {
// Use the assignee of the original PR as the assignee of the cherry-pick
Expand Down Expand Up @@ -85,7 +85,7 @@ export async function run(): Promise<void> {
shouldFastForwardSubmodules
)

const prTitle = `${mergedPR.title} ${prTitleSuffix}`
const prTitle = prTitleSuffix.length > 0 ? `${mergedPR.title} ${prTitleSuffix}` : mergedPR.title

Check failure on line 88 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Replace `·prTitleSuffix.length·>·0·?·`${mergedPR.title}·${prTitleSuffix}`` with `⏎············prTitleSuffix.length·>·0⏎················?·`${mergedPR.title}·${prTitleSuffix}`⏎···············`
const resultPrNumber = await createPullRequest(
githubToken,
mergedPR,
Expand Down

0 comments on commit 064d582

Please sign in to comment.