Add development check before triggering workflow

Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
Max Schmidt 2023-06-27 00:09:30 +02:00
parent eded296fd8
commit d096c22911

View File

@ -16,21 +16,22 @@ const Posts: CollectionConfig = {
console.log(process.env.TOKEN); console.log(process.env.TOKEN);
try { try {
console.log( process.env.NODE_ENV !== "development" &&
await fetch( console.log(
`https://api.github.com/repos/${process.env.REPOSITORY}/dispatches`, await fetch(
{ `https://api.github.com/repos/${process.env.REPOSITORY}/dispatches`,
method: "POST", {
headers: { method: "POST",
Accept: "application/vnd.github.everest-preview+json", headers: {
Authorization: `token ${process.env.TOKEN}`, Accept: "application/vnd.github.everest-preview+json",
}, Authorization: `token ${process.env.TOKEN}`,
body: JSON.stringify({ },
event_type: "payload_update", body: JSON.stringify({
}), event_type: "payload_update",
} }),
) }
); )
);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }