fix: Check if version has changed first

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2022-07-28 17:04:52 +02:00
parent b4b335ca6e
commit fe0b8338e0
No known key found for this signature in database
GPG key ID: BC5E2BD907F9A8EC
3 changed files with 10 additions and 8 deletions

View file

@ -110,13 +110,14 @@ function run() {
return;
}
if (originalChartVersion) {
if (updatedChartVersion == originalChartVersion) {
core.setFailed(`Chart version has not been updated!`);
return;
}
if (!semver.gt(updatedChartVersion, originalChartVersion)) {
core.setFailed(`Updated chart version ${updatedChartVersion} is < ${originalChartVersion}!`);
return;
}
if (updatedChartVersion == originalChartVersion) {
core.setFailed(`Chart version has not been updated!`);
}
core.info(`Old chart version: ${originalChartVersion}`);
}
core.info(`New chart version: ${updatedChartVersion}`);

File diff suppressed because one or more lines are too long

View file

@ -80,6 +80,11 @@ async function run() {
}
if (originalChartVersion) {
if (updatedChartVersion == originalChartVersion) {
core.setFailed(`Chart version has not been updated!`);
return;
}
if (!semver.gt(updatedChartVersion, originalChartVersion)) {
core.setFailed(
`Updated chart version ${updatedChartVersion} is < ${originalChartVersion}!`
@ -87,10 +92,6 @@ async function run() {
return;
}
if (updatedChartVersion == originalChartVersion) {
core.setFailed(`Chart version has not been updated!`);
}
core.info(`Old chart version: ${originalChartVersion}`);
}