-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrelease.ts
30 lines (26 loc) · 1000 Bytes
/
release.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Embed, Webhook } from "jsr:@teever/ez-hook";
const webhookUrl = Deno.env.get("MESSAGE_WEBHOOK");
if (!webhookUrl) {
throw new Error("Missing MESSAGE_WEBHOOK");
}
const values = new Map<string, string>();
for (const arg of Deno.args) {
const [key, value] = arg.split("::");
values.set(key, value);
}
console.log(values);
await new Webhook(webhookUrl)
.setUsername("Website")
.addEmbed(
new Embed()
.setTitle(`New release (${values.get("name")})`)
.addField({ name: "cdrom", value: values.get("cdrom")! })
.addField({
name: "cdrom (no packages)",
value: values.get("cdromMinimal")!,
})
.addField({ name: "libs", value: values.get("libs")! })
.addField({ name: "message", value: values.get("message")! })
.addField({ name: "screenshot", value: values.get("screenshot")! })
.setImage({ url: values.get("screenshot")! }),
).send();