From 1be3456ab4df580d0db04cd584f7c877830110eb Mon Sep 17 00:00:00 2001 From: ShuangYa Date: Thu, 11 Jul 2024 00:34:38 +0800 Subject: [PATCH] scripts: fix snapshot --- scripts/get-snapshot-version.mjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/get-snapshot-version.mjs b/scripts/get-snapshot-version.mjs index c3360d0..e44558a 100644 --- a/scripts/get-snapshot-version.mjs +++ b/scripts/get-snapshot-version.mjs @@ -15,15 +15,14 @@ async function main() { // Get latest release version const gitHubToken = process.env.GITHUB_TOKEN; const gitHubBaseURL = process.env.GITHUB_API_URL + '/repos/' + process.env.GITHUB_REPOSITORY; - const latestReleaseResp = await axios.get(gitHubBaseURL + '/releases/latest', { + const latestRelease = await axios.get(gitHubBaseURL + '/releases/latest', { headers: { 'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer ' + gitHubToken, 'X-GitHub-Api-Version': '2022-11-28', } }); - const latestRelease = await latestReleaseResp.json(); - const versionPrefix = latestRelease.tag_name.replace(/^v/, ''); + const versionPrefix = latestRelease.data.tag_name.replace(/^v/, ''); // Get remote version const params = new URLSearchParams();