From a45f9f6a7572682345b87927ea3aacf723225e0b Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Fri, 14 Apr 2023 12:47:20 +0200 Subject: [PATCH] v4.0.7 --- dist/index.js | 13 ++++++++++--- package.json | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index b5b1c80..1bd8605 100644 --- a/dist/index.js +++ b/dist/index.js @@ -40711,8 +40711,9 @@ try { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.generateChangelog = void 0; const changelogen_1 = __nccwpck_require__(7225); -async function generateChangelog(cwd, newVersion) { +async function generateChangelog(cwd, from, newVersion) { const config = await (0, changelogen_1.loadChangelogConfig)(cwd, { + from, newVersion, }); const rawCommits = await (0, changelogen_1.getGitDiff)(config.from, config.to); @@ -40773,8 +40774,14 @@ async function run() { // This removes the 'refs/tags' portion of the string, i.e. from 'refs/tags/v1.10.15' to 'v1.10.15' const tag = tagName.replace('refs/tags/', ''); const releaseName = core.getInput('release_name', { required: false }) || tag; - console.log('Tag:', tag, 'Release name:', releaseName); - let body = await (0, changelog_js_1.generateChangelog)(process.cwd(), tag.replace(/^v/, '')); + const releases = await github.repos.listReleases({ + owner, + repo, + per_page: 1, + }); + const previousTag = releases.data[0].tag_name; + console.log(`${previousTag} => ${tag}`); + let body = await (0, changelog_js_1.generateChangelog)(process.cwd(), previousTag, tag.replace(/^v/, '')); let lines = body.split('\n'); // Cleanup output const tagFilter = tag.replace('v', ''); diff --git a/package.json b/package.json index fb34aa4..b849ad3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "release-tag", - "version": "4.0.6", + "version": "4.0.7", "description": "", "main": "dist/index.js", "author": "Guillaume CHAU",