feat!: add commit input (#331)

* fix!: remove `signoff` input

* feat: add `commit` input
This commit is contained in:
Federico Grandi
2021-12-03 21:38:30 +01:00
committed by GitHub
parent b1323b2f1c
commit 7392614f5c
5 changed files with 6 additions and 38 deletions

View File

@@ -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(

View File

@@ -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