diff --git a/dist/index.js b/dist/index.js index f337754b..73a6d40d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -505,7 +505,8 @@ async function getToolSemver(data) { return data['version']; } else { - return JSON.parse(response['data']).pop()['ref'].split('/').pop(); + const tag = JSON.parse(response['data']).pop()['ref'].split('/').pop(); + return tag.replace(/^v(\d)/, '$1'); } } exports.getToolSemver = getToolSemver; diff --git a/src/tools.ts b/src/tools.ts index 322876f8..32cd2b44 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -11,7 +11,8 @@ export async function getToolSemver( data['error'] = response.error ?? `No version found with prefix ${ref}.`; return data['version']; } else { - return JSON.parse(response['data']).pop()['ref'].split('/').pop(); + const tag = JSON.parse(response['data']).pop()['ref'].split('/').pop(); + return tag.replace(/^v(\d)/, '$1'); } }