Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
feat: add pull-request-title-pattern option (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
yi-Xu-0100 committed Mar 3, 2021
1 parent 205f648 commit d447fdb
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 142 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -46,6 +46,7 @@ Automate releases with Conventional Commit Messages.
| `fork` | Should the PR be created from a fork. Default `false`|
| `command` | release-please command to run, either `github-release`, or `release-pr` (_defaults to running both_) |
| `default-branch` | branch to open pull release PR against (detected by default) |
| `pull-request-title-pattern` | title pattern used to make release PR, defaults to using `chore${scope}: release${component} ${version}`. |

| output | description |
|:---:|---|
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Expand Up @@ -7,7 +7,7 @@ inputs:
required: false
default: ${{ github.token }}
fork:
description: 'should the PR be proposed from a fork (does not work with secrets.GITHUB_TOKEN)'
description: 'should the PR be proposed from a fork, Default to false'
required: false
default: false
clean:
Expand Down Expand Up @@ -52,6 +52,11 @@ inputs:
description: 'branch to open pull release PR against (detected by default)'
required: false
default: ''
pull-request-title-pattern:
description: 'add title pattern to make release PR, defaults to using "chore${scope}: release${component} ${version}".'
required: false
default: 'chore${scope}: release${component} ${version}'

runs:
using: 'node12'
main: 'dist/index.js'
10 changes: 7 additions & 3 deletions index.js
Expand Up @@ -23,11 +23,12 @@ async function main () {
const token = core.getInput('token', { required: true })
const fork = getBooleanInput('fork')
const changelogPath = core.getInput('changelog-path') || undefined
const changelogTypes = core.getInput('changelog-types')
const changelogTypes = core.getInput('changelog-types') || undefined
const changelogSections = changelogTypes && JSON.parse(changelogTypes)
const command = core.getInput('command') || undefined
const versionFile = core.getInput('version-file') || undefined
const defaultBranch = core.getInput('default-branch') || undefined
const pullRequestTitlePattern = core.getInput('pull-request-title-pattern') || undefined

// First we check for any merged release PRs (PRs merged with the label
// "autorelease: pending"):
Expand All @@ -41,7 +42,8 @@ async function main () {
token,
changelogPath,
releaseType,
defaultBranch
defaultBranch,
pullRequestTitlePattern
})

if (releaseCreated) {
Expand All @@ -68,7 +70,8 @@ async function main () {
bumpMinorPreMajor,
changelogSections,
versionFile,
defaultBranch
defaultBranch,
pullRequestTitlePattern
})

if (pr) {
Expand All @@ -82,6 +85,7 @@ const releasePlease = {
getBooleanInput
}

/* c8 ignore next 4 */
if (require.main === module) {
main().catch(err => {
core.setFailed(`release-please failed: ${err.message}`)
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -26,7 +26,7 @@
"homepage": "https://github.com/bcoe/release-please-action#readme",
"dependencies": {
"@actions/core": "^1.2.6",
"release-please": "^11.0.1"
"release-please": "^11.1.0"
},
"devDependencies": {
"@vercel/ncc": "^0.27.0",
Expand Down

0 comments on commit d447fdb

Please sign in to comment.