Skip to content

Commit a72ed3e

Browse files
committed
fix: should use custom getOptionalInput instead
1 parent d5544d6 commit a72ed3e

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/main.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { runPublish, runVersion } from './run.js'
1010
import { MainCommandOptions } from './types.js'
1111
import { execSync } from './utils.js'
1212

13+
const getOptionalInput = (name: string) => getInput(name) || undefined
14+
1315
export const main = async ({
1416
published,
1517
onlyChangesets,
@@ -93,10 +95,10 @@ export const main = async ({
9395
}
9496
case hasChangesets: {
9597
await runVersion({
96-
script: getInput('version'),
98+
script: getOptionalInput('version'),
9799
gitlabToken: GITLAB_TOKEN!,
98-
prTitle: getInput('title'),
99-
commitMessage: getInput('commit'),
100+
prTitle: getOptionalInput('title'),
101+
commitMessage: getOptionalInput('commit'),
100102
hasPublishScript,
101103
})
102104
if (onlyChangesets) {

src/run.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ ${
268268
.map(x => x.content)
269269
.join('\n '))()
270270

271-
const finalPrTitle = `${prTitle}${preState ? ` (${preState.tag})` : ''}`
271+
const finalMrTitle = `${prTitle}${preState ? ` (${preState.tag})` : ''}`
272272

273273
// project with `commit: true` setting could have already committed files
274274
if (!(await gitUtils.checkIfClean())) {
@@ -290,21 +290,21 @@ ${
290290
})
291291
console.log(JSON.stringify(searchResult, null, 2))
292292
if (searchResult.length === 0) {
293-
console.log('creating pull request')
293+
console.log('creating merge request')
294294
await api.MergeRequests.create(
295295
context.projectId,
296296
versionBranch,
297297
branch,
298-
finalPrTitle,
298+
finalMrTitle,
299299
{
300300
description: await prBodyPromise,
301301
},
302302
)
303303
} else {
304304
await api.MergeRequests.edit(context.projectId, searchResult[0].iid, {
305-
title: finalPrTitle,
305+
title: finalMrTitle,
306306
description: await prBodyPromise,
307307
})
308-
console.log('pull request found')
308+
console.log('merge request found')
309309
}
310310
}

0 commit comments

Comments
 (0)