From 4e998d0dea87847ea872b8ca6d0e8ac737b745b4 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 11 Jan 2024 19:11:48 -0800 Subject: [PATCH] fix: Strip v prefix from tags. --- CHANGELOG.md | 4 ++++ index.ts | 10 ++++++++-- package.json | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d235f1..d32df1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.2 + +- Strip `v` from tags when checking changelogs and setting output. + # 0.2.1 - Renamed to `build-wasm-plugin`. diff --git a/index.ts b/index.ts index e989d08..5954b4f 100644 --- a/index.ts +++ b/index.ts @@ -29,9 +29,15 @@ function detectVersion() { const ref = process.env.GITHUB_REF; if (ref && ref.startsWith('refs/tags/')) { - PLUGIN_VERSION = ref.replace('refs/tags/', ''); + let version = ref.replace('refs/tags/', ''); - core.setOutput('tag-version', PLUGIN_VERSION); + if (version.startsWith('v') || version.startsWith('V')) { + version = version.slice(1); + } + + core.setOutput('tag-version', version); + + PLUGIN_VERSION = version; } } diff --git a/package.json b/package.json index 8ad3485..d0e7562 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moonrepo/build-wasm-plugin", - "version": "0.2.1", + "version": "0.2.2", "description": "A GitHub action to build, optimize, and prepare WASM plugins for release.", "main": "dist/index.js", "scripts": {