From 437f835378012c4195503e545020e464e5bb673e Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Fri, 18 Oct 2019 12:35:00 +0200 Subject: [PATCH 1/3] docs: Update README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c39861a..c8825aa 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,11 @@ This action will bump version, tag commit and generate a changelog with conventi ```yaml - name: Conventional Changelog Action - uses: TriPSs/conventional-changelog-action@v0.0.1 + uses: TriPSs/conventional-changelog-action@v1.2.0 with: github-token: ${{ secrets.github_token }} git-message: 'chore(release): {version}' preset: 'angular' tag-prefix: 'v' output-file: 'CHANGELOG.md' - ``` From da75f5939add67131c5c804a1e2973ba6667957b Mon Sep 17 00:00:00 2001 From: Nati Oskar Date: Tue, 4 Feb 2020 14:19:48 +0200 Subject: [PATCH 2/3] feat: Make the releaseCount configurable --- README.md | 2 ++ action.yml | 5 +++++ src/helpers/generateChangelog.js | 4 ++-- src/index.js | 3 ++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c8825aa..af3eac9 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ This action will bump version, tag commit and generate a changelog with conventi - **Optional** `preset`: Preset that is used from conventional commits. Default `angular`. - **Optional** `tag-prefix`: Prefix for the git tags. Default `v`. - **Optional** `output-file`: File to output the changelog to. Default `CHANGELOG.md`. +- **Optional** `changelog-release-count`: FNumber of releases to preserve in changelog. Default `5`, use `0` to regenerate all. ## Example usage @@ -21,4 +22,5 @@ This action will bump version, tag commit and generate a changelog with conventi preset: 'angular' tag-prefix: 'v' output-file: 'CHANGELOG.md' + changelog-release-count: 5 ``` diff --git a/action.yml b/action.yml index 98cd9f0..308ab82 100644 --- a/action.yml +++ b/action.yml @@ -32,3 +32,8 @@ inputs: description: 'File to output the changelog to' default: 'CHANGELOG.md' required: false + + changelog-release-count: + description: 'Number of releases to preserve in changelog' + default: 5 + required: false \ No newline at end of file diff --git a/src/helpers/generateChangelog.js b/src/helpers/generateChangelog.js index a519dc9..8e30ecf 100644 --- a/src/helpers/generateChangelog.js +++ b/src/helpers/generateChangelog.js @@ -1,10 +1,10 @@ const fs = require('fs') const conventionalChangelog = require('conventional-changelog') -module.exports = (tagPrefix, preset, jsonPackage, fileName) => new Promise((resolve) => { +module.exports = (tagPrefix, preset, jsonPackage, fileName, releaseCount) => new Promise((resolve) => { const changelogStream = conventionalChangelog({ preset, - releaseCount: 5, + releaseCount, }, { version: jsonPackage.version, diff --git a/src/index.js b/src/index.js index ab75e43..4015e86 100644 --- a/src/index.js +++ b/src/index.js @@ -11,6 +11,7 @@ async function run() { const tagPrefix = core.getInput('tag-prefix') const preset = core.getInput('preset') const outputFile = core.getInput('output-file') + const releaseCount = core.getInput('changelog-release-count') core.info(`Using "${preset}" preset`) @@ -33,7 +34,7 @@ async function run() { core.info(`New version: ${jsonPackage.version}`) // Generate the changelog - await generateChangelog(tagPrefix, preset, jsonPackage, outputFile) + await generateChangelog(tagPrefix, preset, jsonPackage, outputFile, releaseCount) core.info('Push all changes') From 8f15b677d6fd0cb612a719e626574612003c8229 Mon Sep 17 00:00:00 2001 From: Nati Oskar Date: Tue, 4 Feb 2020 15:25:13 +0200 Subject: [PATCH 3/3] fixed typo, README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af3eac9..a2a66cf 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This action will bump version, tag commit and generate a changelog with conventi - **Optional** `preset`: Preset that is used from conventional commits. Default `angular`. - **Optional** `tag-prefix`: Prefix for the git tags. Default `v`. - **Optional** `output-file`: File to output the changelog to. Default `CHANGELOG.md`. -- **Optional** `changelog-release-count`: FNumber of releases to preserve in changelog. Default `5`, use `0` to regenerate all. +- **Optional** `changelog-release-count`: Number of releases to preserve in changelog. Default `5`, use `0` to regenerate all. ## Example usage