mirror of
https://github.com/joaquinjsb/gitea-release-please-action
synced 2026-05-08 15:01:12 +02:00
feat: add pull-request-header input (#615)
Co-authored-by: Jeff Ching <chingor@google.com>
This commit is contained in:
committed by
GitHub
parent
7a173c3827
commit
9963ea2aa8
@@ -60,6 +60,7 @@ Automate releases with Conventional Commit Messages.
|
|||||||
| `command` | release-please command to run, either `github-release`, or `release-pr`, `manifest`, `manifest-pr` (_defaults to running both_) |
|
| `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) |
|
| `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-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*`. |
|
||||||
| `changelog-path` | configure alternate path for `CHANGELOG.md`. Default `CHANGELOG.md` |
|
| `changelog-path` | configure alternate path for `CHANGELOG.md`. Default `CHANGELOG.md` |
|
||||||
| `github-api-url` | configure github API URL. Default `https://api.github.com` |
|
| `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@example.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@example.com\>") |
|
||||||
|
|||||||
@@ -91,6 +91,9 @@ inputs:
|
|||||||
pull-request-title-pattern:
|
pull-request-title-pattern:
|
||||||
description: 'add title pattern to make release PR, defaults to using "chore${scope}: release${component} ${version}"'
|
description: 'add title pattern to make release PR, defaults to using "chore${scope}: release${component} ${version}"'
|
||||||
required: false
|
required: false
|
||||||
|
pull-request-header:
|
||||||
|
description: 'set release PR header, defaults to using ":robot: I have created a release *beep* *boop*"'
|
||||||
|
required: false
|
||||||
draft:
|
draft:
|
||||||
description: 'mark release as a draft'
|
description: 'mark release as a draft'
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
2
index.js
2
index.js
@@ -141,6 +141,7 @@ async function manifestInstance (github) {
|
|||||||
const versionFile = core.getInput('version-file') || undefined
|
const versionFile = core.getInput('version-file') || undefined
|
||||||
const extraFiles = core.getMultilineInput('extra-files') || undefined
|
const extraFiles = core.getMultilineInput('extra-files') || undefined
|
||||||
const pullRequestTitlePattern = core.getInput('pull-request-title-pattern') || undefined
|
const pullRequestTitlePattern = core.getInput('pull-request-title-pattern') || undefined
|
||||||
|
const pullRequestHeader = core.getInput('pull-request-header') || undefined
|
||||||
const draft = getOptionalBooleanInput('draft')
|
const draft = getOptionalBooleanInput('draft')
|
||||||
const draftPullRequest = getOptionalBooleanInput('draft-pull-request')
|
const draftPullRequest = getOptionalBooleanInput('draft-pull-request')
|
||||||
const changelogType = core.getInput('changelog-notes-type') || undefined
|
const changelogType = core.getInput('changelog-notes-type') || undefined
|
||||||
@@ -179,6 +180,7 @@ async function manifestInstance (github) {
|
|||||||
extraFiles,
|
extraFiles,
|
||||||
includeComponentInTag: monorepoTags,
|
includeComponentInTag: monorepoTags,
|
||||||
pullRequestTitlePattern,
|
pullRequestTitlePattern,
|
||||||
|
pullRequestHeader,
|
||||||
draftPullRequest,
|
draftPullRequest,
|
||||||
versioning,
|
versioning,
|
||||||
releaseAs,
|
releaseAs,
|
||||||
|
|||||||
@@ -159,6 +159,39 @@ describe('release-please-action', () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('opens PR with custom header', async () => {
|
||||||
|
input = {
|
||||||
|
command: 'release-pr',
|
||||||
|
'release-type': 'node',
|
||||||
|
'pull-request-header': 'another header',
|
||||||
|
'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(
|
||||||
|
'pullRequestHeader',
|
||||||
|
'another header'
|
||||||
|
),
|
||||||
|
sinon.match.any
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
it('both opens PR to the default branch and tags GitHub releases by default', async () => {
|
it('both opens PR to the default branch and tags GitHub releases by default', async () => {
|
||||||
input = {
|
input = {
|
||||||
'skip-github-release': 'false',
|
'skip-github-release': 'false',
|
||||||
|
|||||||
Reference in New Issue
Block a user