Skip to content

Commit

Permalink
Trim 'v' prefix from shipIt's version to avoid double prefixing tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Mar 20, 2024
1 parent cf7b237 commit 8b1e88d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/publish-action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ const publishAction = async ({ major, version, repo }) => {
} else {
const data = JSON.parse(process.env.ARG_0);
context = data.context;
version = data.newVersion;
version = data.newVersion.replace(/^v/, '');
console.info(`📌 Using auto shipIt context: ${context}`);
console.info(`📌 Using auto shipIt version: ${version}`);
console.info(`Commits in release:`);
data.commitsInRelease.forEach((c) => console.info(`- ${c.hash.slice(0, 8)} ${c.subject}`));
}

const [, major, minor, patch] = version.match(/(\d+)\.(\d+)\.(\d+)-*(\w+)?/) || [];
const [, major, minor, patch] = version.match(/^(\d+)\.(\d+)\.(\d+)-*(\w+)?/) || [];
if (!major || !minor || !patch) {
console.error(`❗️ Invalid version: ${version}`);
return;
Expand Down

0 comments on commit 8b1e88d

Please sign in to comment.