From c26b34b60736e70de2bc6c4760a85761c40f033c Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Thu, 16 Apr 2020 10:28:28 +0200 Subject: [PATCH 1/3] docs: Update README --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 248c692..a2b951c 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,22 @@ 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`: 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. -## Example usage +## Example usages +Uses all the defaults ```yaml - name: Conventional Changelog Action - uses: TriPSs/conventional-changelog-action@v1.2.0 + uses: TriPSs/conventional-changelog-action@v2.0.1 + with: + github-token: ${{ secrets.github_token }} +``` + +Overwrite everything +```yaml +- name: Conventional Changelog Action + uses: TriPSs/conventional-changelog-action@v2.0.1 with: github-token: ${{ secrets.github_token }} git-message: 'chore(release): {version}' From 42a37c6d0e4ff5b6ee7006bf670a27a571cd4235 Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Tue, 28 Apr 2020 17:14:05 +0200 Subject: [PATCH 2/3] chore: Added stale app --- .github/stale.yml | 17 +++++++++++++++++ .github/workflows/{main.yml => release.yml} | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .github/stale.yml rename .github/workflows/{main.yml => release.yml} (96%) diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..dc90e5a --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/.github/workflows/main.yml b/.github/workflows/release.yml similarity index 96% rename from .github/workflows/main.yml rename to .github/workflows/release.yml index 42575bb..54d228d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: - 'releases/*' jobs: - test: + release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 From c18a89eed164e4414b30da38013938f498abef11 Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Tue, 28 Apr 2020 17:14:52 +0200 Subject: [PATCH 3/3] feat: Added the option to provide the location of the packge.json --- README.md | 6 ++++-- action.yml | 5 +++++ src/helpers/packageJson.js | 3 ++- src/index.js | 6 ++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a2b951c..2f3f36c 100644 --- a/README.md +++ b/README.md @@ -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' ``` diff --git a/action.yml b/action.yml index c58c405..f329101 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/src/helpers/packageJson.js b/src/helpers/packageJson.js index cf52238..037f446 100644 --- a/src/helpers/packageJson.js +++ b/src/helpers/packageJson.js @@ -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 = { diff --git a/src/index.js b/src/index.js index f846983..d50d6d2 100644 --- a/src/index.js +++ b/src/index.js @@ -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) {