feat!: add commit input (#331)
* fix!: remove `signoff` input * feat: add `commit` input
This commit is contained in:
@@ -77,10 +77,6 @@ Add a step like this to your workflow:
|
||||
# Default: ''
|
||||
remove: './dir/old_file.js'
|
||||
|
||||
# Whether to use the --signoff option on `git commit` (only boolean values accepted*)
|
||||
# Default: false
|
||||
signoff: true
|
||||
|
||||
# Arguments for the git tag command (the tag name always needs to be the first word not preceded by an hyphen)
|
||||
# Default: ''
|
||||
tag: 'v1.0.0 --force'
|
||||
|
||||
@@ -19,6 +19,9 @@ inputs:
|
||||
description: How the action should behave when the targeted branch is missing
|
||||
required: false
|
||||
default: throw
|
||||
commit:
|
||||
description: Additional arguments for the git commit command
|
||||
required: false
|
||||
committer_name:
|
||||
description: The name of the custom committer you want to use
|
||||
required: false
|
||||
@@ -56,9 +59,6 @@ inputs:
|
||||
remove:
|
||||
description: Arguments for the git rm command
|
||||
required: false
|
||||
signoff:
|
||||
description: Whether to use the --signoff option on git commit
|
||||
required: false
|
||||
tag:
|
||||
description: Arguments for the git tag command (the tag name always needs to be the first word not preceded by a hyphen)
|
||||
required: false
|
||||
|
||||
2
lib/index.js
generated
2
lib/index.js
generated
File diff suppressed because one or more lines are too long
30
src/main.ts
30
src/main.ts
@@ -97,14 +97,7 @@ core.info(`Running in ${baseDir}`)
|
||||
core.info('> Creating commit...')
|
||||
await git.commit(
|
||||
getInput('message'),
|
||||
undefined,
|
||||
{
|
||||
...(getInput('signoff')
|
||||
? {
|
||||
'--signoff': null
|
||||
}
|
||||
: {})
|
||||
},
|
||||
matchGitArgs(getInput('commit') || ''),
|
||||
(err, data?: CommitSummary) => {
|
||||
if (data) {
|
||||
setOutput('committed', 'true')
|
||||
@@ -404,27 +397,6 @@ async function checkInputs() {
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region signoff
|
||||
if (getInput('signoff')) {
|
||||
const parsed = getInput('signoff', true)
|
||||
|
||||
if (parsed === undefined)
|
||||
throw new Error(
|
||||
`"${getInput(
|
||||
'signoff'
|
||||
)}" is not a valid value for the 'signoff' input: only "true" and "false" are allowed.`
|
||||
)
|
||||
|
||||
if (!parsed) setInput('signoff', undefined)
|
||||
|
||||
core.debug(
|
||||
`Current signoff option: ${getInput('signoff')} (${typeof getInput(
|
||||
'signoff'
|
||||
)})`
|
||||
)
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region github_token
|
||||
if (!getInput('github_token'))
|
||||
core.warning(
|
||||
|
||||
@@ -9,6 +9,7 @@ interface InputTypes {
|
||||
author_email: string
|
||||
branch: string
|
||||
branch_mode: 'throw' | 'create'
|
||||
commit: string | undefined
|
||||
committer_name: string
|
||||
committer_email: string
|
||||
cwd: string
|
||||
@@ -19,7 +20,6 @@ interface InputTypes {
|
||||
pull_strategy: string | undefined
|
||||
push: string
|
||||
remove: string | undefined
|
||||
signoff: undefined
|
||||
tag: string | undefined
|
||||
|
||||
github_token: string | undefined
|
||||
|
||||
Reference in New Issue
Block a user