commit
78f731c36b
|
@ -34,6 +34,11 @@ inputs:
|
||||||
default: '--ff-only'
|
default: '--ff-only'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
git-push:
|
||||||
|
description: 'Should all the git changes be push'
|
||||||
|
default: 'true'
|
||||||
|
required: false
|
||||||
|
|
||||||
preset:
|
preset:
|
||||||
description: 'The preset from Conventional Changelog to use'
|
description: 'The preset from Conventional Changelog to use'
|
||||||
default: 'angular'
|
default: 'angular'
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
|
@ -24,19 +24,19 @@
|
||||||
},
|
},
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "1.2.6",
|
"@actions/core": "1.6.0",
|
||||||
"@actions/exec": "1.0.4",
|
"@actions/exec": "1.1.0",
|
||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
"conventional-changelog": "3.1.23",
|
"conventional-changelog": "3.1.24",
|
||||||
"conventional-recommended-bump": "6.0.10",
|
"conventional-recommended-bump": "6.1.0",
|
||||||
"git-semver-tags": "4.1.0",
|
"git-semver-tags": "4.1.1",
|
||||||
"object-path": "^0.11.5",
|
"object-path": "^0.11.8",
|
||||||
"semver": "^7.3.2",
|
"semver": "^7.3.5",
|
||||||
"yaml": "^1.10.0"
|
"yaml": "^1.10.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "11.0.0",
|
"@commitlint/cli": "13.2.0",
|
||||||
"@commitlint/config-conventional": "11.0.0",
|
"@commitlint/config-conventional": "13.2.0",
|
||||||
"husky": "4.3.6"
|
"husky": "4.3.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
21
src/index.js
21
src/index.js
|
@ -28,6 +28,7 @@ async function run() {
|
||||||
const gitCommitMessage = core.getInput('git-message')
|
const gitCommitMessage = core.getInput('git-message')
|
||||||
const gitUserName = core.getInput('git-user-name')
|
const gitUserName = core.getInput('git-user-name')
|
||||||
const gitUserEmail = core.getInput('git-user-email')
|
const gitUserEmail = core.getInput('git-user-email')
|
||||||
|
const gitPush = core.getInput('git-push').toLowerCase() === 'true'
|
||||||
const tagPrefix = core.getInput('tag-prefix')
|
const tagPrefix = core.getInput('tag-prefix')
|
||||||
const preset = !core.getInput('config-file-path') ? core.getInput('preset') : ''
|
const preset = !core.getInput('config-file-path') ? core.getInput('preset') : ''
|
||||||
const preCommitFile = core.getInput('pre-commit')
|
const preCommitFile = core.getInput('pre-commit')
|
||||||
|
@ -68,7 +69,7 @@ async function run() {
|
||||||
|
|
||||||
const config = conventionalConfigFile && requireScript(conventionalConfigFile)
|
const config = conventionalConfigFile && requireScript(conventionalConfigFile)
|
||||||
|
|
||||||
conventionalRecommendedBump({ preset, tagPrefix, config }, async(error, recommendation) => {
|
conventionalRecommendedBump({ preset, tagPrefix, config }, async (error, recommendation) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
return
|
return
|
||||||
|
@ -172,8 +173,22 @@ async function run() {
|
||||||
// Create the new tag
|
// Create the new tag
|
||||||
await git.createTag(gitTag)
|
await git.createTag(gitTag)
|
||||||
|
|
||||||
core.info('Push all changes')
|
if (gitPush) {
|
||||||
await git.push()
|
try {
|
||||||
|
core.info('Push all changes')
|
||||||
|
await git.push()
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
|
||||||
|
core.setFailed(error)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
core.info('We not going to push the GIT changes')
|
||||||
|
}
|
||||||
|
|
||||||
// Set outputs so other actions (for example actions/create-release) can use it
|
// Set outputs so other actions (for example actions/create-release) can use it
|
||||||
core.setOutput('changelog', stringChangelog)
|
core.setOutput('changelog', stringChangelog)
|
||||||
|
|
Loading…
Reference in New Issue