Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
Add draft and prerelease options (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
BelKed authored Apr 6, 2021
1 parent 9918ca0 commit 142a1c5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ inputs:
description: Specify if you want get changelog in reverse order
required: false
default: 'desc'
draft:
description: Set to true if you want to have draft release
required: false
default: 'false'
prerelease:
description: Set to true if you want to have prerelease instead release
required: false
default: 'false'
runs:
using: 'node12'
main: 'distribution/index.js'
6 changes: 4 additions & 2 deletions distribution/index.js

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

6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ async function run() {
const exclude = core.getInput('exclude');
const dateFormat = core.getInput('date-format');
const reverseSort = core.getInput('reverse-sort');
const isDraft = core.getInput('draft') === 'true';
const isPrerelease = core.getInput('prerelease') === 'true';

// Fetch tags from remote
await execFile('git', ['fetch', 'origin', '+refs/tags/*:refs/tags/*']);
Expand Down Expand Up @@ -51,8 +53,8 @@ async function run() {
name: releaseTitle.replace('{tag}', pushedTag),
tag_name: pushedTag, // eslint-disable-line camelcase
body: await generateReleaseNotes({range, exclude, commitTemplate, releaseTemplate, dateFormat, reverseSort}),
draft: false,
prerelease: false
draft: isDraft,
prerelease: isPrerelease
});

core.info('Created release `' + createReleaseResponse.data.id + '` for tag `' + pushedTag + '`');
Expand Down
14 changes: 14 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ Example: `asc`

Set to `asc` if you want to have changelog printed in reverse order.

### draft

Default: `false` <br>
Example: `true`

Set to `true` if you want to have draft release.

### prerelease

Default: `false` <br>
Example: `true`

Set to `true` if you want to have prerelease instead release.

## Outputs

None.
Expand Down

0 comments on commit 142a1c5

Please sign in to comment.