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);
try {
console.log(
await fetch(
`https://api.github.com/repos/${process.env.REPOSITORY}/dispatches`,
{
method: "POST",
headers: {
Accept: "application/vnd.github.everest-preview+json",
Authorization: `token ${process.env.TOKEN}`,
},
body: JSON.stringify({
event_type: "payload_update",
}),
}
)
);
process.env.NODE_ENV !== "development" &&
console.log(
await fetch(
`https://api.github.com/repos/${process.env.REPOSITORY}/dispatches`,
{
method: "POST",
headers: {
Accept: "application/vnd.github.everest-preview+json",
Authorization: `token ${process.env.TOKEN}`,
},
body: JSON.stringify({
event_type: "payload_update",
}),
}
)
);
} catch (e) {
console.log(e);
}