From f9317d571a9ba52ad7d6f21986167892a248ec0a Mon Sep 17 00:00:00 2001 From: Eunjae Lee Date: Wed, 6 Apr 2022 11:39:17 +0200 Subject: [PATCH] chore(ci): fix commit parsing logic (#336) --- scripts/release/create-release-issue.ts | 9 ++++++++- scripts/release/process-release.ts | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/release/create-release-issue.ts b/scripts/release/create-release-issue.ts index 568a3def77..0d88bf458f 100755 --- a/scripts/release/create-release-issue.ts +++ b/scripts/release/create-release-issue.ts @@ -179,9 +179,16 @@ async function createReleaseIssue(): Promise { const commitsWithUnknownLanguageScope: string[] = []; const commitsWithoutLanguageScope: string[] = []; + // Remove the local tag, and fetch it from the remote. + // We move the `released` tag as we release, so we need to make it up-to-date. + await run(`git tag -d ${RELEASED_TAG}`); + await run( + `git fetch origin refs/tags/${RELEASED_TAG}:refs/tags/${RELEASED_TAG}` + ); + // Reading commits since last release const latestCommits = ( - await run(`git log --oneline ${RELEASED_TAG}..${MAIN_BRANCH}`) + await run(`git log --oneline --abbrev=8 ${RELEASED_TAG}..${MAIN_BRANCH}`) ) .split('\n') .filter(Boolean) diff --git a/scripts/release/process-release.ts b/scripts/release/process-release.ts index 927d1cd2f2..6f336b5fec 100755 --- a/scripts/release/process-release.ts +++ b/scripts/release/process-release.ts @@ -269,7 +269,9 @@ async function processRelease(): Promise { await run(`git push`); // remove old `released` tag - await run(`git fetch origin refs/tags/released:refs/tags/released`); + await run( + `git fetch origin refs/tags/${RELEASED_TAG}:refs/tags/${RELEASED_TAG}` + ); await run(`git tag -d ${RELEASED_TAG}`); await run(`git push --delete origin ${RELEASED_TAG}`);