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: adds pull-request-footer setting #854

Closed
wants to merge 1 commit 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Automate releases with Conventional Commit Messages.
| `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}`. |
| `pull-request-header` | header used within the release PR body, defaults to using `:robot: I have created a release *beep* *boop*`. |
| `pull-request-footer` | footer used within the release PR body, defaults to using `This PR was generated with Release Please. See documentation.`. |
| `changelog-path` | configure alternate path for `CHANGELOG.md`. Default `CHANGELOG.md` |
| `github-api-url` | configure github API URL. Default `https://api.github.com` |
| `signoff` | Add [`Signed-off-by`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff) line at the end of the commit log message using the user and email provided. (format "Name \<[email protected]\>") |
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ inputs:
pull-request-header:
description: 'set release PR header, defaults to using ":robot: I have created a release *beep* *boop*"'
required: false
pull-request-footer:
description: 'set release PR footer, defaults to using "This PR was generated with Release Please. See documentation.'
required: false
draft:
description: 'mark release as a draft'
required: false
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ async function manifestInstance (github) {
const extraFiles = core.getMultilineInput('extra-files') || undefined
const pullRequestTitlePattern = core.getInput('pull-request-title-pattern') || undefined
const pullRequestHeader = core.getInput('pull-request-header') || undefined
const pullRequestFooter = core.getInput('pull-request-footer') || undefined
const draft = getOptionalBooleanInput('draft')
const draftPullRequest = getOptionalBooleanInput('draft-pull-request')
const changelogType = core.getInput('changelog-notes-type') || undefined
Expand Down Expand Up @@ -181,6 +182,7 @@ async function manifestInstance (github) {
includeComponentInTag: monorepoTags,
pullRequestTitlePattern,
pullRequestHeader,
pullRequestFooter,
draftPullRequest,
versioning,
releaseAs,
Expand Down
33 changes: 33 additions & 0 deletions test/release-please.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,39 @@ describe('release-please-action', () => {
)
})

it('opens PR with custom footer', async () => {
input = {
command: 'release-pr',
'release-type': 'node',
'pull-request-footer': 'another footer',
'skip-github-release': 'false',
prerelease: 'false',
'include-v-in-tag': 'true',
'always-link-local': 'true',
'separate-pull-requests': 'false',
'skip-labeling': 'false',
'sequential-calls': 'false'
}

const createPullRequestsFake = sandbox.fake.returns([fixturePrs[0]])
const createManifestCommand = sandbox.stub(Manifest, 'fromConfig').returns({
createPullRequests: createPullRequestsFake
})
await action.main()

sinon.assert.calledOnce(createPullRequestsFake)
sinon.assert.calledWith(
createManifestCommand,
sinon.match.any,
'main',
sinon.match.hasOwn(
'pullRequestFooter',
'another footer'
),
sinon.match.any
)
})

it('both opens PR to the default branch and tags GitHub releases by default', async () => {
input = {
'skip-github-release': 'false',
Expand Down