Data Request API helper #10
1 changed files with 17 additions and 16 deletions
|
|
@ -9,22 +9,23 @@ const {
|
||||||
|
|
||||||
console.log(process.env);
|
console.log(process.env);
|
||||||
|
|
||||||
// async function main() {
|
async function main() {
|
||||||
// const requestURL = `${API_URL}/repos/${REPO}/tags/${TAG_NAME}`;
|
const requestURL = `${API_URL}/repos/${REPO}/tags/${TAG_NAME}`;
|
||||||
|
|
||||||
// const response = await axios.get(
|
const response = await axios.get(
|
||||||
// requestURL,
|
requestURL,
|
||||||
// {
|
{
|
||||||
// headers: { Authorization: `token ${TOKEN}` },
|
headers: { Authorization: `token ${TOKEN}` },
|
||||||
// validateStatus: () => true,
|
validateStatus: () => true,
|
||||||
// },
|
},
|
||||||
// );
|
);
|
||||||
|
|
||||||
// // We actually *want* an error when the tag exists, instead of when
|
// We actually *want* an error when the tag exists, instead of when
|
||||||
// // it doesn't
|
// it doesn't
|
||||||
// if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
// process.exit(1);
|
console.log(`Tag with name "${TAG_NAME}" already exists`);
|
||||||
// };
|
process.exit(1);
|
||||||
// };
|
};
|
||||||
|
};
|
||||||
|
|
||||||
// main();
|
main();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue