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