Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(input): allow draft github release #397

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Automate releases with Conventional Commit Messages.
| `changelog-types` | A JSON formatted String containing to override the outputted changelog sections |
| `version-file` | provide a path to a version file to increment (used by ruby releaser) |
| `fork` | Should the PR be created from a fork. Default `false`|
| `draft` | Should the GitHub release be a draft. Default `false`|
| `command` | release-please command to run, either `github-release`, or `release-pr`, `manifest`, `manifest-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}`. |
Expand All @@ -76,6 +77,7 @@ Automate releases with Conventional Commit Messages.
| `patch` | Number representing patch semver value |
| `sha` | sha that a GitHub release was tagged at |
| `pr` | The PR number of an opened release (undefined if no release created) |
| `draft` | `true` if the GitHub release is a draft, `false` otherwise |

### Release types supported

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ inputs:
description: 'configure github repository URL. Default `process.env.GITHUB_REPOSITORY`'
required: false
default: ''
draft:
description: 'should the GitHub release be a draft'
required: false
default: false

runs:
using: 'node12'
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ async function main () {
const bumpMinorPreMajor = getBooleanInput('bump-minor-pre-major')
const bumpPatchForMinorPreMajor = getBooleanInput('bump-patch-for-minor-pre-major')
const monorepoTags = getBooleanInput('monorepo-tags')
const draft = getBooleanInput('draft')
const packageName = core.getInput('package-name')
const path = core.getInput('path') || undefined
const releaseType = core.getInput('release-type', { required: true })
Expand All @@ -112,7 +113,8 @@ async function main () {
defaultBranch,
pullRequestTitlePattern,
apiUrl,
graphqlUrl
graphqlUrl,
draft
})

if (releaseCreated) {
Expand Down
6 changes: 4 additions & 2 deletions test/release-please.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const defaultInput = {
'version-file': '',
'default-branch': '',
// eslint-disable-next-line no-template-curly-in-string
'pull-request-title-pattern': 'chore${scope}: release${component} ${version}'
'pull-request-title-pattern': 'chore${scope}: release${component} ${version}',
draft: 'false'
}

let input
Expand Down Expand Up @@ -254,7 +255,8 @@ describe('release-please-action', () => {
patch: 3,
version: 'v1.2.3',
sha: 'abc123',
pr: 33
pr: 33,
draft: false
}
input = {
'release-type': 'node',
Expand Down