feat: Added the option to provide the location of the packge.json
parent
42a37c6d0e
commit
c18a89eed1
|
@ -10,13 +10,14 @@ This action will bump version, tag commit and generate a changelog with conventi
|
|||
- **Optional** `tag-prefix`: Prefix for the git tags. Default `v`.
|
||||
- **Optional** `output-file`: File to output the changelog to. Default `CHANGELOG.md`.
|
||||
- **Optional** `release-count`: Number of releases to preserve in changelog. Default `5`, use `0` to regenerate all.
|
||||
- **Optional** `package-json`: The path to the package.json to use. Default `./package.json`.
|
||||
|
||||
## Example usages
|
||||
|
||||
Uses all the defaults
|
||||
```yaml
|
||||
- name: Conventional Changelog Action
|
||||
uses: TriPSs/conventional-changelog-action@v2.0.1
|
||||
uses: TriPSs/conventional-changelog-action@v2.1.0
|
||||
with:
|
||||
github-token: ${{ secrets.github_token }}
|
||||
```
|
||||
|
@ -24,7 +25,7 @@ Uses all the defaults
|
|||
Overwrite everything
|
||||
```yaml
|
||||
- name: Conventional Changelog Action
|
||||
uses: TriPSs/conventional-changelog-action@v2.0.1
|
||||
uses: TriPSs/conventional-changelog-action@v2.1.0
|
||||
with:
|
||||
github-token: ${{ secrets.github_token }}
|
||||
git-message: 'chore(release): {version}'
|
||||
|
@ -32,4 +33,5 @@ Overwrite everything
|
|||
tag-prefix: 'v'
|
||||
output-file: 'CHANGELOG.md'
|
||||
release-count: '5'
|
||||
package-json: './package.json'
|
||||
```
|
||||
|
|
|
@ -38,3 +38,8 @@ inputs:
|
|||
description: 'Number of releases to preserve in changelog'
|
||||
default: '5'
|
||||
required: false
|
||||
|
||||
package-json:
|
||||
description: 'The path to the package.json to use'
|
||||
default: './package.json'
|
||||
required: false
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const core = require('@actions/core')
|
||||
|
||||
const packageJsonLoc = path.resolve('./', 'package.json')
|
||||
const packageJsonLoc = path.resolve(core.getInput('package-json'))
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
|
|
@ -12,8 +12,14 @@ async function run() {
|
|||
const preset = core.getInput('preset')
|
||||
const outputFile = core.getInput('output-file')
|
||||
const releaseCount = core.getInput('release-count')
|
||||
const packageJsonToUse = core.getInput('package-json')
|
||||
|
||||
core.info(`Using "${preset}" preset`)
|
||||
core.info(`Using "${commitMessage}" as commit message`)
|
||||
core.info(`Using "${releaseCount}" release count`)
|
||||
core.info(`Using "${packageJsonToUse}"`)
|
||||
core.info(`Using "${tagPrefix}" as tag prefix`)
|
||||
core.info(`Using "${outputFile}" as output file`)
|
||||
|
||||
conventionalRecommendedBump({ preset }, async(error, recommendation) => {
|
||||
if (error) {
|
||||
|
|
Loading…
Reference in New Issue