Skip to content

Commit 7392614

Browse files
authored
feat!: add commit input (actions#331)
* fix!: remove `signoff` input * feat: add `commit` input
1 parent b1323b2 commit 7392614

File tree

5 files changed

+6
-38
lines changed

5 files changed

+6
-38
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ Add a step like this to your workflow:
7777
# Default: ''
7878
remove: './dir/old_file.js'
7979

80-
# Whether to use the --signoff option on `git commit` (only boolean values accepted*)
81-
# Default: false
82-
signoff: true
83-
8480
# Arguments for the git tag command (the tag name always needs to be the first word not preceded by an hyphen)
8581
# Default: ''
8682
tag: 'v1.0.0 --force'

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ inputs:
1919
description: How the action should behave when the targeted branch is missing
2020
required: false
2121
default: throw
22+
commit:
23+
description: Additional arguments for the git commit command
24+
required: false
2225
committer_name:
2326
description: The name of the custom committer you want to use
2427
required: false
@@ -56,9 +59,6 @@ inputs:
5659
remove:
5760
description: Arguments for the git rm command
5861
required: false
59-
signoff:
60-
description: Whether to use the --signoff option on git commit
61-
required: false
6262
tag:
6363
description: Arguments for the git tag command (the tag name always needs to be the first word not preceded by a hyphen)
6464
required: false

lib/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,7 @@ core.info(`Running in ${baseDir}`)
9797
core.info('> Creating commit...')
9898
await git.commit(
9999
getInput('message'),
100-
undefined,
101-
{
102-
...(getInput('signoff')
103-
? {
104-
'--signoff': null
105-
}
106-
: {})
107-
},
100+
matchGitArgs(getInput('commit') || ''),
108101
(err, data?: CommitSummary) => {
109102
if (data) {
110103
setOutput('committed', 'true')
@@ -404,27 +397,6 @@ async function checkInputs() {
404397
}
405398
// #endregion
406399

407-
// #region signoff
408-
if (getInput('signoff')) {
409-
const parsed = getInput('signoff', true)
410-
411-
if (parsed === undefined)
412-
throw new Error(
413-
`"${getInput(
414-
'signoff'
415-
)}" is not a valid value for the 'signoff' input: only "true" and "false" are allowed.`
416-
)
417-
418-
if (!parsed) setInput('signoff', undefined)
419-
420-
core.debug(
421-
`Current signoff option: ${getInput('signoff')} (${typeof getInput(
422-
'signoff'
423-
)})`
424-
)
425-
}
426-
// #endregion
427-
428400
// #region github_token
429401
if (!getInput('github_token'))
430402
core.warning(

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface InputTypes {
99
author_email: string
1010
branch: string
1111
branch_mode: 'throw' | 'create'
12+
commit: string | undefined
1213
committer_name: string
1314
committer_email: string
1415
cwd: string
@@ -19,7 +20,6 @@ interface InputTypes {
1920
pull_strategy: string | undefined
2021
push: string
2122
remove: string | undefined
22-
signoff: undefined
2323
tag: string | undefined
2424

2525
github_token: string | undefined

0 commit comments

Comments
 (0)