Skip to content

Commit d447fdb

Browse files
authored
feat: add pull-request-title-pattern option (#259)
1 parent 205f648 commit d447fdb

6 files changed

Lines changed: 160 additions & 142 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Automate releases with Conventional Commit Messages.
4646
| `fork` | Should the PR be created from a fork. Default `false`|
4747
| `command` | release-please command to run, either `github-release`, or `release-pr` (_defaults to running both_) |
4848
| `default-branch` | branch to open pull release PR against (detected by default) |
49+
| `pull-request-title-pattern` | title pattern used to make release PR, defaults to using `chore${scope}: release${component} ${version}`. |
4950

5051
| output | description |
5152
|:---:|---|

action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ inputs:
77
required: false
88
default: ${{ github.token }}
99
fork:
10-
description: 'should the PR be proposed from a fork (does not work with secrets.GITHUB_TOKEN)'
10+
description: 'should the PR be proposed from a fork, Default to false'
1111
required: false
1212
default: false
1313
clean:
@@ -52,6 +52,11 @@ inputs:
5252
description: 'branch to open pull release PR against (detected by default)'
5353
required: false
5454
default: ''
55+
pull-request-title-pattern:
56+
description: 'add title pattern to make release PR, defaults to using "chore${scope}: release${component} ${version}".'
57+
required: false
58+
default: 'chore${scope}: release${component} ${version}'
59+
5560
runs:
5661
using: 'node12'
5762
main: 'dist/index.js'

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ async function main () {
2323
const token = core.getInput('token', { required: true })
2424
const fork = getBooleanInput('fork')
2525
const changelogPath = core.getInput('changelog-path') || undefined
26-
const changelogTypes = core.getInput('changelog-types')
26+
const changelogTypes = core.getInput('changelog-types') || undefined
2727
const changelogSections = changelogTypes && JSON.parse(changelogTypes)
2828
const command = core.getInput('command') || undefined
2929
const versionFile = core.getInput('version-file') || undefined
3030
const defaultBranch = core.getInput('default-branch') || undefined
31+
const pullRequestTitlePattern = core.getInput('pull-request-title-pattern') || undefined
3132

3233
// First we check for any merged release PRs (PRs merged with the label
3334
// "autorelease: pending"):
@@ -41,7 +42,8 @@ async function main () {
4142
token,
4243
changelogPath,
4344
releaseType,
44-
defaultBranch
45+
defaultBranch,
46+
pullRequestTitlePattern
4547
})
4648

4749
if (releaseCreated) {
@@ -68,7 +70,8 @@ async function main () {
6870
bumpMinorPreMajor,
6971
changelogSections,
7072
versionFile,
71-
defaultBranch
73+
defaultBranch,
74+
pullRequestTitlePattern
7275
})
7376

7477
if (pr) {
@@ -82,6 +85,7 @@ const releasePlease = {
8285
getBooleanInput
8386
}
8487

88+
/* c8 ignore next 4 */
8589
if (require.main === module) {
8690
main().catch(err => {
8791
core.setFailed(`release-please failed: ${err.message}`)

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"homepage": "https://github.com/bcoe/release-please-action#readme",
2727
"dependencies": {
2828
"@actions/core": "^1.2.6",
29-
"release-please": "^11.0.1"
29+
"release-please": "^11.1.0"
3030
},
3131
"devDependencies": {
3232
"@vercel/ncc": "^0.27.0",

0 commit comments

Comments
 (0)