Skip to content

Commit

Permalink
Merge pull request #4 from satackey/add-commit-message-input
Browse files Browse the repository at this point in the history
Make commit message configurable
  • Loading branch information
satackey authored May 2, 2020
2 parents 9d610ee + f3eb8fe commit 0419704
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ An automatic Docker builder is under development. Coming soon!
- `release-tags` optional
The names to tag the compiled file commit.

- `commit-message` optional
The commit message for the compiled.

## Contribution
PRs are accepted.

Expand Down
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ branding:
color: white

inputs:
release-branch:
push-branch:
description: The name of branch to push compiled file.
required: true

release-tags:
description: The names to tag the compiled file commit.
required: false

commit-message:
description: The commit message for the compiled.
required: true
default: '[auto]'

runs:
using: node12
main: index.js
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ const clean = (...excludePaths) => {
core.endGroup()
}

const push = async (branch, tags) => {
const push = async (branch, tags, message) => {
core.startGroup('git')
await exec.exec('git checkout -b ', [branch])
await exec.exec('git add .')
await exec.exec('git commit -m [auto]')
await exec.exec('git commit -m', message)
console.log(tags)
if (tags.length > 0) {
await exec.exec('git tag', tags)
Expand All @@ -181,12 +181,14 @@ const main = async () => {
const tags = typeof core.getInput('release-tags') === 'string' && core.getInput('release-tags').length > 0
? core.getInput('release-tags').split(' ') : []

const commitMessage = core.getInput('commit-message', { required: true })

await configureGit()
await installNcc()
await installDependencies()
const builtFiles = await buildAction()
clean(builtFiles)
await push(releaseBranch, tags)
await push(releaseBranch, tags, commitMessage)
}

main().catch(e => {
Expand Down

0 comments on commit 0419704

Please sign in to comment.