feat:Allow skipping of the Git pull before tagging
parent
4f6a9eceb8
commit
5ff4cb3443
17
README.md
17
README.md
|
@ -16,6 +16,7 @@ This action will bump version, tag commit and generate a changelog with conventi
|
||||||
- **Optional** `release-count`: Number of releases to preserve in changelog. Default `5`, use `0` to regenerate all.
|
- **Optional** `release-count`: Number of releases to preserve in changelog. Default `5`, use `0` to regenerate all.
|
||||||
- **Optional** `version-file`: The path to the file that contains the version to bump. Default `./package.json`.
|
- **Optional** `version-file`: The path to the file that contains the version to bump. Default `./package.json`.
|
||||||
- **Optional** `version-path`: The place inside the version file to bump. Default `version`.
|
- **Optional** `version-path`: The place inside the version file to bump. Default `version`.
|
||||||
|
- **Optional** `skip-git-pull`: Do not pull the repo before tagging. Ensure you full cloned the repo in the first place to get tags. Default `'false'`.
|
||||||
- **Optional** `skip-on-empty`: Boolean to specify if you want to skip empty release (no-changelog generated). This case occured when you push `chore` commit with `angular` for example. Default `'true'`.
|
- **Optional** `skip-on-empty`: Boolean to specify if you want to skip empty release (no-changelog generated). This case occured when you push `chore` commit with `angular` for example. Default `'true'`.
|
||||||
- **Optional** `skip-version-file`: Do not update the version file. Default `'false'`.
|
- **Optional** `skip-version-file`: Do not update the version file. Default `'false'`.
|
||||||
- **Optional** `skip-commit`: Do not create a release commit. Default `'false'`.
|
- **Optional** `skip-commit`: Do not create a release commit. Default `'false'`.
|
||||||
|
@ -148,6 +149,22 @@ Tag only
|
||||||
skip-commit: "true"
|
skip-commit: "true"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Skip Git Pull
|
||||||
|
In CI you might not want to pull extra changes before tagging e.g. if running a long build before tagging, another commit may have come into the branch which would get pulled leading to tagging a different commit to the one which was built.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Conventional Changelog Action
|
||||||
|
uses: TriPSs/conventional-changelog-action@v3
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.github_token }}
|
||||||
|
skip-git-pull: "true"
|
||||||
|
```
|
||||||
|
|
||||||
Use a custom file for versioning
|
Use a custom file for versioning
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
|
@ -70,6 +70,11 @@ inputs:
|
||||||
default: 'version'
|
default: 'version'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
skip-git-pull:
|
||||||
|
description: 'Do not pull the repo before tagging. Ensure you full cloned the repo in the first place to get tags'
|
||||||
|
default: 'false'
|
||||||
|
required: false
|
||||||
|
|
||||||
skip-on-empty:
|
skip-on-empty:
|
||||||
description: 'Do nothing when the changelog from the latest release is empty'
|
description: 'Do nothing when the changelog from the latest release is empty'
|
||||||
default: 'true'
|
default: 'true'
|
||||||
|
|
|
@ -36,6 +36,7 @@ async function run() {
|
||||||
const releaseCount = core.getInput('release-count')
|
const releaseCount = core.getInput('release-count')
|
||||||
const versionFile = core.getInput('version-file')
|
const versionFile = core.getInput('version-file')
|
||||||
const versionPath = core.getInput('version-path')
|
const versionPath = core.getInput('version-path')
|
||||||
|
const skipGitPull = core.getInput('skip-git-pull').toLowerCase() === 'true'
|
||||||
const skipVersionFile = core.getInput('skip-version-file').toLowerCase() === 'true'
|
const skipVersionFile = core.getInput('skip-version-file').toLowerCase() === 'true'
|
||||||
const skipCommit = core.getInput('skip-commit').toLowerCase() === 'true'
|
const skipCommit = core.getInput('skip-commit').toLowerCase() === 'true'
|
||||||
const skipEmptyRelease = core.getInput('skip-on-empty').toLowerCase() === 'true'
|
const skipEmptyRelease = core.getInput('skip-on-empty').toLowerCase() === 'true'
|
||||||
|
@ -64,8 +65,10 @@ async function run() {
|
||||||
core.info(`Skipping empty releases is "${skipEmptyRelease ? 'enabled' : 'disabled'}"`)
|
core.info(`Skipping empty releases is "${skipEmptyRelease ? 'enabled' : 'disabled'}"`)
|
||||||
core.info(`Skipping the update of the version file is "${skipVersionFile ? 'enabled' : 'disabled'}"`)
|
core.info(`Skipping the update of the version file is "${skipVersionFile ? 'enabled' : 'disabled'}"`)
|
||||||
|
|
||||||
core.info('Pull to make sure we have the full git history')
|
if (!skipGitPull) {
|
||||||
await git.pull()
|
core.info('Pull to make sure we have the full git history')
|
||||||
|
await git.pull()
|
||||||
|
}
|
||||||
|
|
||||||
const config = conventionalConfigFile && requireScript(conventionalConfigFile)
|
const config = conventionalConfigFile && requireScript(conventionalConfigFile)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue