From 57f9c347ff43e54929faa13a3b4df5f1e60520ab Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 16 Nov 2025 10:43:57 -0700 Subject: [PATCH] Add functionality back in --- scripts/tagExists.mjs | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/scripts/tagExists.mjs b/scripts/tagExists.mjs index f223bce..6b6a6fa 100644 --- a/scripts/tagExists.mjs +++ b/scripts/tagExists.mjs @@ -9,22 +9,23 @@ const { console.log(process.env); -// async function main() { -// const requestURL = `${API_URL}/repos/${REPO}/tags/${TAG_NAME}`; +async function main() { + const requestURL = `${API_URL}/repos/${REPO}/tags/${TAG_NAME}`; -// const response = await axios.get( -// requestURL, -// { -// headers: { Authorization: `token ${TOKEN}` }, -// validateStatus: () => true, -// }, -// ); + const response = await axios.get( + requestURL, + { + headers: { Authorization: `token ${TOKEN}` }, + validateStatus: () => true, + }, + ); -// // We actually *want* an error when the tag exists, instead of when -// // it doesn't -// if (response.status === 200) { -// process.exit(1); -// }; -// }; + // We actually *want* an error when the tag exists, instead of when + // it doesn't + if (response.status === 200) { + console.log(`Tag with name "${TAG_NAME}" already exists`); + process.exit(1); + }; +}; -// main(); +main();