debug
This commit is contained in:
parent
9fba850eb7
commit
bbfbaf4b2d
25
dist/index.js
vendored
25
dist/index.js
vendored
@ -62110,8 +62110,8 @@ function processAdditionalRegistries(targetRegistries) {
|
|||||||
const additionalRegistriesArr = additionalRegistries.split(',');
|
const additionalRegistriesArr = additionalRegistries.split(',');
|
||||||
for (let registry of additionalRegistriesArr) {
|
for (let registry of additionalRegistriesArr) {
|
||||||
registry = registry.trim();
|
registry = registry.trim();
|
||||||
if (!registry.endsWith(':')) {
|
if (registry.endsWith(':')) {
|
||||||
registry += ':';
|
registry = registry.substring(0, registry.length - 1);
|
||||||
}
|
}
|
||||||
targetRegistries.push(registry);
|
targetRegistries.push(registry);
|
||||||
}
|
}
|
||||||
@ -62170,31 +62170,32 @@ function writeRegistryAuthJson(registryAuthJson, targetFile) {
|
|||||||
external_fs_.writeFileSync(targetFile, JSON.stringify(registryAuthJson, null, 2));
|
external_fs_.writeFileSync(targetFile, JSON.stringify(registryAuthJson, null, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isNonEmptyStr(str) {
|
||||||
|
return str != null && str !== 'false' && str.length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
function collectTags(information) {
|
function collectTags(information) {
|
||||||
const tags = [];
|
const tags = [];
|
||||||
let foundSemverTag = false;
|
let foundSemverTag = false;
|
||||||
let tagPrefix = (core.getInput('tag_prefix') ?? '').trim();
|
let tagPrefix = (core.getInput('tag_prefix') ?? '').trim();
|
||||||
let tagSuffix = (core.getInput('tag_suffix') ?? '').trim();
|
let tagSuffix = (core.getInput('tag_suffix') ?? '').trim();
|
||||||
let tagCommitPrefix = (core.getInput('tag_suffix') ?? '').trim();
|
let tagCommitPrefix = (core.getInput('tag_commit_prefix') ?? '').trim();
|
||||||
|
|
||||||
// handle semver
|
// handle semver
|
||||||
if (
|
if (
|
||||||
core.getBooleanInput('tag_semver_major') &&
|
core.getBooleanInput('tag_semver_major') && isNonEmptyStr(information.semver_major)
|
||||||
information.semver_major != null
|
|
||||||
) {
|
) {
|
||||||
tags.push(tagPrefix + information.semver_major);
|
tags.push(tagPrefix + information.semver_major);
|
||||||
foundSemverTag = true;
|
foundSemverTag = true;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
core.getBooleanInput('tag_semver_minor') &&
|
core.getBooleanInput('tag_semver_minor') && isNonEmptyStr(information.semver_minor)
|
||||||
information.semver_minor != null
|
|
||||||
) {
|
) {
|
||||||
tags.push(tagPrefix + information.semver_minor);
|
tags.push(tagPrefix + information.semver_minor);
|
||||||
foundSemverTag = true;
|
foundSemverTag = true;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
core.getBooleanInput('tag_semver_patch') &&
|
core.getBooleanInput('tag_semver_patch') && isNonEmptyStr(information.semver_patch)
|
||||||
information.semver_patch != null
|
|
||||||
) {
|
) {
|
||||||
tags.push(tagPrefix + information.semver_patch);
|
tags.push(tagPrefix + information.semver_patch);
|
||||||
foundSemverTag = true;
|
foundSemverTag = true;
|
||||||
@ -62205,18 +62206,18 @@ function collectTags(information) {
|
|||||||
core.getBooleanInput('tag_ref_normalized_enable') &&
|
core.getBooleanInput('tag_ref_normalized_enable') &&
|
||||||
foundSemverTag === false
|
foundSemverTag === false
|
||||||
) {
|
) {
|
||||||
if (information.git_tag != null) {
|
if (isNonEmptyStr(information.git_tag)) {
|
||||||
// TODO normalize tag from git for docker
|
// TODO normalize tag from git for docker
|
||||||
tags.push(tagPrefix + information.git_tag + tagSuffix);
|
tags.push(tagPrefix + information.git_tag + tagSuffix);
|
||||||
}
|
}
|
||||||
if (information.git_current_branch != null) {
|
if (isNonEmptyStr(information.git_current_branch)) {
|
||||||
// TODO normalize branch from git for docker
|
// TODO normalize branch from git for docker
|
||||||
tags.push(tagPrefix + information.git_current_branch + tagSuffix);
|
tags.push(tagPrefix + information.git_current_branch + tagSuffix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle commit sha
|
// handle commit sha
|
||||||
if (core.getBooleanInput('tag_commit_enable')) {
|
if (core.getBooleanInput('tag_commit_enable') && isNonEmptyStr(github.context.sha)) {
|
||||||
tags.push(tagPrefix + tagCommitPrefix + github.context.sha + tagSuffix);
|
tags.push(tagPrefix + tagCommitPrefix + github.context.sha + tagSuffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
25
src/lib.js
25
src/lib.js
@ -10,8 +10,8 @@ export function processAdditionalRegistries(targetRegistries) {
|
|||||||
const additionalRegistriesArr = additionalRegistries.split(',');
|
const additionalRegistriesArr = additionalRegistries.split(',');
|
||||||
for (let registry of additionalRegistriesArr) {
|
for (let registry of additionalRegistriesArr) {
|
||||||
registry = registry.trim();
|
registry = registry.trim();
|
||||||
if (!registry.endsWith(':')) {
|
if (registry.endsWith(':')) {
|
||||||
registry += ':';
|
registry = registry.substring(0, registry.length - 1);
|
||||||
}
|
}
|
||||||
targetRegistries.push(registry);
|
targetRegistries.push(registry);
|
||||||
}
|
}
|
||||||
@ -70,31 +70,32 @@ export function writeRegistryAuthJson(registryAuthJson, targetFile) {
|
|||||||
fs.writeFileSync(targetFile, JSON.stringify(registryAuthJson, null, 2));
|
fs.writeFileSync(targetFile, JSON.stringify(registryAuthJson, null, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isNonEmptyStr(str) {
|
||||||
|
return str != null && str !== 'false' && str.length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
export function collectTags(information) {
|
export function collectTags(information) {
|
||||||
const tags = [];
|
const tags = [];
|
||||||
let foundSemverTag = false;
|
let foundSemverTag = false;
|
||||||
let tagPrefix = (core.getInput('tag_prefix') ?? '').trim();
|
let tagPrefix = (core.getInput('tag_prefix') ?? '').trim();
|
||||||
let tagSuffix = (core.getInput('tag_suffix') ?? '').trim();
|
let tagSuffix = (core.getInput('tag_suffix') ?? '').trim();
|
||||||
let tagCommitPrefix = (core.getInput('tag_suffix') ?? '').trim();
|
let tagCommitPrefix = (core.getInput('tag_commit_prefix') ?? '').trim();
|
||||||
|
|
||||||
// handle semver
|
// handle semver
|
||||||
if (
|
if (
|
||||||
core.getBooleanInput('tag_semver_major') &&
|
core.getBooleanInput('tag_semver_major') && isNonEmptyStr(information.semver_major)
|
||||||
information.semver_major != null
|
|
||||||
) {
|
) {
|
||||||
tags.push(tagPrefix + information.semver_major);
|
tags.push(tagPrefix + information.semver_major);
|
||||||
foundSemverTag = true;
|
foundSemverTag = true;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
core.getBooleanInput('tag_semver_minor') &&
|
core.getBooleanInput('tag_semver_minor') && isNonEmptyStr(information.semver_minor)
|
||||||
information.semver_minor != null
|
|
||||||
) {
|
) {
|
||||||
tags.push(tagPrefix + information.semver_minor);
|
tags.push(tagPrefix + information.semver_minor);
|
||||||
foundSemverTag = true;
|
foundSemverTag = true;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
core.getBooleanInput('tag_semver_patch') &&
|
core.getBooleanInput('tag_semver_patch') && isNonEmptyStr(information.semver_patch)
|
||||||
information.semver_patch != null
|
|
||||||
) {
|
) {
|
||||||
tags.push(tagPrefix + information.semver_patch);
|
tags.push(tagPrefix + information.semver_patch);
|
||||||
foundSemverTag = true;
|
foundSemverTag = true;
|
||||||
@ -105,18 +106,18 @@ export function collectTags(information) {
|
|||||||
core.getBooleanInput('tag_ref_normalized_enable') &&
|
core.getBooleanInput('tag_ref_normalized_enable') &&
|
||||||
foundSemverTag === false
|
foundSemverTag === false
|
||||||
) {
|
) {
|
||||||
if (information.git_tag != null) {
|
if (isNonEmptyStr(information.git_tag)) {
|
||||||
// TODO normalize tag from git for docker
|
// TODO normalize tag from git for docker
|
||||||
tags.push(tagPrefix + information.git_tag + tagSuffix);
|
tags.push(tagPrefix + information.git_tag + tagSuffix);
|
||||||
}
|
}
|
||||||
if (information.git_current_branch != null) {
|
if (isNonEmptyStr(information.git_current_branch)) {
|
||||||
// TODO normalize branch from git for docker
|
// TODO normalize branch from git for docker
|
||||||
tags.push(tagPrefix + information.git_current_branch + tagSuffix);
|
tags.push(tagPrefix + information.git_current_branch + tagSuffix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle commit sha
|
// handle commit sha
|
||||||
if (core.getBooleanInput('tag_commit_enable')) {
|
if (core.getBooleanInput('tag_commit_enable') && isNonEmptyStr(github.context.sha)) {
|
||||||
tags.push(tagPrefix + tagCommitPrefix + github.context.sha + tagSuffix);
|
tags.push(tagPrefix + tagCommitPrefix + github.context.sha + tagSuffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user