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: add template input #1365

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -371,6 +371,7 @@ The Release Drafter GitHub Action accepts a number of optional inputs directly i
| `latest` | A string indicating whether the release being created or updated should be marked as latest. |
| `commitish` | A string specifying the target branch for the release being created. |
| `header` | A string that would be added before the template body. |
| `template` | The template for the body of the release. |
| `footer` | A string that would be added after the template body. |

## Action Outputs
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Expand Up @@ -58,6 +58,10 @@ inputs:
A string that would be added before the template body.
required: false
default: ''
template:
description: |
The template for the body of the release.
required: false
footer:
description: |
A string that would be added after the template body.
Expand Down
4 changes: 4 additions & 0 deletions index.js
Expand Up @@ -269,6 +269,10 @@ function updateConfigFromInput(config, input) {
config.header = input.header
}

if (input.template) {
config.template = input.template
}

if (input.footer) {
config.footer = input.footer
}
Expand Down
2 changes: 2 additions & 0 deletions lib/default-config.js
Expand Up @@ -32,6 +32,8 @@ const DEFAULT_CONFIG = Object.freeze({
commitish: '',
'category-template': `## $TITLE`,
header: '',
template:
"# What's Changed\n$CHANGES\n**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION",
footer: '',
})

Expand Down