Merge pull request #63 from onpointglobal/fix/62-contextualize-commits-analysis

#62 - commits analyzed repeatedly
This commit is contained in:
Mathieu Dutour 2021-02-24 17:50:57 +01:00 committed by GitHub
commit 8dc6c0deb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import {
mapCustomReleaseRules,
} from './utils';
import { createTag } from './github';
import { Await } from './ts';
export default async function main() {
const defaultBump = core.getInput('default_bump') as ReleaseType | 'false';
@ -63,11 +64,13 @@ export default async function main() {
prefixRegex
);
const commits = await getCommits(latestTag.commit.sha, GITHUB_SHA);
let commits: Await<ReturnType<typeof getCommits>>;
let newVersion: string;
if (customTag) {
commits = await getCommits(latestTag.commit.sha, GITHUB_SHA);
newVersion = customTag;
} else {
let previousTag: ReturnType<typeof getLatestTag> | null;
@ -101,6 +104,8 @@ export default async function main() {
core.setOutput('previous_version', previousVersion.version);
core.setOutput('previous_tag', previousTag.name);
commits = await getCommits(previousTag.commit.sha, GITHUB_SHA);
let bump = await analyzeCommits(
{ releaseRules: mappedReleaseRules },
{ commits, logger: { log: console.info.bind(console) } }