add singular flag to disable semver tagging

This commit is contained in:
David Hiendl 2023-12-06 15:35:12 +01:00
parent f8153aa179
commit 7fb1ffb6a6
3 changed files with 30 additions and 22 deletions

View File

@ -36,6 +36,10 @@ inputs:
description: ""
default: "true"
tag_semver_enable:
description: "set to false to disable semver tagging completely"
default: "true"
tag_semver_major:
description: ""
default: "true"

24
dist/index.js vendored
View File

@ -62205,17 +62205,19 @@ function collectTags(information) {
let tagCommitPrefix = (core.getInput('tag_commit_prefix') ?? '').trim();
// handle semver
if (core.getBooleanInput('tag_semver_major') && isNonEmptyStr(information.semver_major)) {
tags.push(tagPrefix + information.semver_major);
foundSemverTag = true;
}
if (core.getBooleanInput('tag_semver_minor') && isNonEmptyStr(information.semver_minor)) {
tags.push(tagPrefix + information.semver_minor);
foundSemverTag = true;
}
if (core.getBooleanInput('tag_semver_patch') && isNonEmptyStr(information.semver_patch)) {
tags.push(tagPrefix + information.semver_patch);
foundSemverTag = true;
if (core.getBooleanInput('tag_semver_enable')) {
if (core.getBooleanInput('tag_semver_major') && isNonEmptyStr(information.semver_major)) {
tags.push(tagPrefix + information.semver_major);
foundSemverTag = true;
}
if (core.getBooleanInput('tag_semver_minor') && isNonEmptyStr(information.semver_minor)) {
tags.push(tagPrefix + information.semver_minor);
foundSemverTag = true;
}
if (core.getBooleanInput('tag_semver_patch') && isNonEmptyStr(information.semver_patch)) {
tags.push(tagPrefix + information.semver_patch);
foundSemverTag = true;
}
}
// handle git tag/branch

View File

@ -101,17 +101,19 @@ export function collectTags(information) {
let tagCommitPrefix = (core.getInput('tag_commit_prefix') ?? '').trim();
// handle semver
if (core.getBooleanInput('tag_semver_major') && isNonEmptyStr(information.semver_major)) {
tags.push(tagPrefix + information.semver_major);
foundSemverTag = true;
}
if (core.getBooleanInput('tag_semver_minor') && isNonEmptyStr(information.semver_minor)) {
tags.push(tagPrefix + information.semver_minor);
foundSemverTag = true;
}
if (core.getBooleanInput('tag_semver_patch') && isNonEmptyStr(information.semver_patch)) {
tags.push(tagPrefix + information.semver_patch);
foundSemverTag = true;
if (core.getBooleanInput('tag_semver_enable')) {
if (core.getBooleanInput('tag_semver_major') && isNonEmptyStr(information.semver_major)) {
tags.push(tagPrefix + information.semver_major);
foundSemverTag = true;
}
if (core.getBooleanInput('tag_semver_minor') && isNonEmptyStr(information.semver_minor)) {
tags.push(tagPrefix + information.semver_minor);
foundSemverTag = true;
}
if (core.getBooleanInput('tag_semver_patch') && isNonEmptyStr(information.semver_patch)) {
tags.push(tagPrefix + information.semver_patch);
foundSemverTag = true;
}
}
// handle git tag/branch