From 50ab4fa80a641d1a198fb5fe17536a5db6a39a3a Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Wed, 29 Apr 2020 10:03:43 +0200 Subject: [PATCH 1/3] fix: Pull full history so it works with checkout@v2 --- .github/workflows/release.yml | 2 +- package.json | 2 +- src/helpers/git.js | 9 +++++++++ src/index.js | 3 +++ yarn.lock | 8 ++++---- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54d228d..0981726 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - run: yarn --production - run: git add node_modules -f diff --git a/package.json b/package.json index a1920e3..f9ff410 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "homepage": "https://github.com/TriPSs/conventional-changelog-action#readme", "dependencies": { "@actions/core": "1.2.3", - "@actions/exec": "1.0.3", + "@actions/exec": "1.0.4", "conventional-changelog": "3.1.18", "conventional-recommended-bump": "6.0.5" } diff --git a/src/helpers/git.js b/src/helpers/git.js index bc2c0cc..d6c0ffa 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -84,6 +84,15 @@ module.exports = new (class Git { this.exec(`commit -m "${message}" ${args.join(' ')}`) ) + /** + * Pull the full history + * + * @return {Promise<>} + */ + pull = () => ( + this.exec(`git pull --unshallow`) + ) + /** * Push all changes * diff --git a/src/index.js b/src/index.js index d50d6d2..9b8c57a 100644 --- a/src/index.js +++ b/src/index.js @@ -22,6 +22,9 @@ async function run() { core.info(`Using "${outputFile}" as output file`) conventionalRecommendedBump({ preset }, async(error, recommendation) => { + core.info('Pull to make sure we have the full git history') + await git.pull() + if (error) { core.setFailed(error.message) diff --git a/yarn.lock b/yarn.lock index bd497d6..d4e6675 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.2.3.tgz#e844b4fa0820e206075445079130868f95bfca95" integrity sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w== -"@actions/exec@1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-1.0.3.tgz#b967f8700d6ff011dcc91243b58bafc1bb9ab95f" - integrity sha512-TogJGnueOmM7ntCi0ASTUj4LapRRtDfj57Ja4IhPmg2fls28uVOPbAn8N+JifaOumN2UG3oEO/Ixek2A4NcYSA== +"@actions/exec@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-1.0.4.tgz#99d75310e62e59fc37d2ee6dcff6d4bffadd3a5d" + integrity sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw== dependencies: "@actions/io" "^1.0.1" From 5b65653fe8cedf1219e523bf44ee0a7453dcc8d2 Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Wed, 29 Apr 2020 10:04:02 +0200 Subject: [PATCH 2/3] fix: Fixed tagPrefix not being provided to bumper --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9b8c57a..e80df94 100644 --- a/src/index.js +++ b/src/index.js @@ -21,10 +21,10 @@ async function run() { core.info(`Using "${tagPrefix}" as tag prefix`) core.info(`Using "${outputFile}" as output file`) - conventionalRecommendedBump({ preset }, async(error, recommendation) => { core.info('Pull to make sure we have the full git history') await git.pull() + conventionalRecommendedBump({ preset, tagPrefix }, async(error, recommendation) => { if (error) { core.setFailed(error.message) From e66c42b7603eadc663e120f1355b7da328301ece Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Wed, 29 Apr 2020 10:04:19 +0200 Subject: [PATCH 3/3] fix: Fixed tagPrefix being provided as context instead of option --- src/helpers/generateChangelog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/generateChangelog.js b/src/helpers/generateChangelog.js index 68e5ac4..7fc2c1f 100644 --- a/src/helpers/generateChangelog.js +++ b/src/helpers/generateChangelog.js @@ -4,12 +4,12 @@ const conventionalChangelog = require('conventional-changelog') module.exports = (tagPrefix, preset, jsonPackage, fileName, releaseCount) => new Promise((resolve) => { const changelogStream = conventionalChangelog({ preset, - releaseCount: parseInt(releaseCount, 10) + releaseCount: parseInt(releaseCount, 10), + tagPrefix }, { version: jsonPackage.version, currentTag: `${tagPrefix}${jsonPackage.version}`, - tagPrefix, }, )