Skip to content

Commit 0419704

Browse files
authored
Merge pull request #4 from satackey/add-commit-message-input
Make commit message configurable
2 parents 9d610ee + f3eb8fe commit 0419704

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ An automatic Docker builder is under development. Coming soon!
3939
- `release-tags` optional
4040
The names to tag the compiled file commit.
4141

42+
- `commit-message` optional
43+
The commit message for the compiled.
44+
4245
## Contribution
4346
PRs are accepted.
4447

action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ branding:
66
color: white
77

88
inputs:
9-
release-branch:
9+
push-branch:
1010
description: The name of branch to push compiled file.
1111
required: true
12+
1213
release-tags:
1314
description: The names to tag the compiled file commit.
1415
required: false
1516

17+
commit-message:
18+
description: The commit message for the compiled.
19+
required: true
20+
default: '[auto]'
21+
1622
runs:
1723
using: node12
1824
main: index.js

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ const clean = (...excludePaths) => {
157157
core.endGroup()
158158
}
159159

160-
const push = async (branch, tags) => {
160+
const push = async (branch, tags, message) => {
161161
core.startGroup('git')
162162
await exec.exec('git checkout -b ', [branch])
163163
await exec.exec('git add .')
164-
await exec.exec('git commit -m [auto]')
164+
await exec.exec('git commit -m', message)
165165
console.log(tags)
166166
if (tags.length > 0) {
167167
await exec.exec('git tag', tags)
@@ -181,12 +181,14 @@ const main = async () => {
181181
const tags = typeof core.getInput('release-tags') === 'string' && core.getInput('release-tags').length > 0
182182
? core.getInput('release-tags').split(' ') : []
183183

184+
const commitMessage = core.getInput('commit-message', { required: true })
185+
184186
await configureGit()
185187
await installNcc()
186188
await installDependencies()
187189
const builtFiles = await buildAction()
188190
clean(builtFiles)
189-
await push(releaseBranch, tags)
191+
await push(releaseBranch, tags, commitMessage)
190192
}
191193

192194
main().catch(e => {

0 commit comments

Comments
 (0)