Fix repeated version_prefix

This commit is contained in:
Shivam Mathur 2021-07-10 02:10:33 +05:30
parent 5afed16e5f
commit 7eec3d790d
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 4 additions and 2 deletions

3
dist/index.js vendored
View File

@ -505,7 +505,8 @@ async function getToolSemver(data) {
return data['version']; return data['version'];
} }
else { 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; exports.getToolSemver = getToolSemver;

View File

@ -11,7 +11,8 @@ export async function getToolSemver(
data['error'] = response.error ?? `No version found with prefix ${ref}.`; data['error'] = response.error ?? `No version found with prefix ${ref}.`;
return data['version']; return data['version'];
} else { } 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');
} }
} }