Skip to content
This repository was archived by the owner on Feb 19, 2026. It is now read-only.

Commit e9f8e6a

Browse files
committed
ci: remove parseArgs CLI option and use environment variable directly
1 parent 5dee332 commit e9f8e6a

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

script/beta.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bun
22

33
import { Script } from "@opencode-ai/script"
4-
import { parseArgs } from "util"
54

65
interface PR {
76
number: number
@@ -21,10 +20,10 @@ interface FailedPR {
2120
reason: string
2221
}
2322

24-
async function postToDiscord(failures: FailedPR[], webhookUrl?: string) {
25-
const url = webhookUrl || process.env.DISCORD_ISSUES_WEBHOOK_URL
26-
if (!url) {
27-
console.log("Warning: No Discord webhook URL provided, skipping notification")
23+
async function postToDiscord(failures: FailedPR[]) {
24+
const webhookUrl = process.env.DISCORD_ISSUES_WEBHOOK_URL
25+
if (!webhookUrl) {
26+
console.log("Warning: DISCORD_ISSUES_WEBHOOK_URL not set, skipping Discord notification")
2827
return
2928
}
3029

@@ -38,7 +37,7 @@ Please resolve these conflicts manually.`
3837

3938
const content = JSON.stringify({ content: message })
4039

41-
const response = await fetch(url, {
40+
const response = await fetch(webhookUrl, {
4241
method: "POST",
4342
headers: { "Content-Type": "application/json" },
4443
body: content,
@@ -52,15 +51,6 @@ Please resolve these conflicts manually.`
5251
}
5352

5453
async function main() {
55-
const { values } = parseArgs({
56-
args: Bun.argv.slice(2),
57-
options: {
58-
"discord-webhook": { type: "string", short: "d" },
59-
},
60-
})
61-
62-
const discordWebhook = values["discord-webhook"] as string | undefined
63-
6454
console.log("Fetching open PRs from team members...")
6555

6656
const allPrs: PR[] = []
@@ -155,7 +145,7 @@ async function main() {
155145
console.log(`Failed: ${failed.length} PRs`)
156146
failed.forEach((f) => console.log(` - PR #${f.number}: ${f.reason}`))
157147

158-
await postToDiscord(failed, discordWebhook)
148+
await postToDiscord(failed)
159149

160150
throw new Error(`${failed.length} PR(s) failed to merge. Check Discord for details.`)
161151
}

0 commit comments

Comments
 (0)