Created
June 8, 2024 02:03
-
-
Save JosXa/f221a1dfc68b0a5d0c46c46bf35c30c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "@johnlindquist/kit" | |
import { showError } from "@josxa/kit-utils" | |
import { Octokit } from "@octokit/rest" | |
export const metadata: Metadata = { | |
name: "Roadmap Editor", | |
} | |
const token = await env("GITHUB_FULL_ACCESS_TOKEN") | |
const gh = new Octokit({ | |
auth: token, | |
}) | |
const ISSUE = { | |
owner: "johnlindquist", | |
repo: "kit", | |
issue_number: 1483, | |
} as const | |
const existing = await gh.issues.get(ISSUE) | |
const body = existing.data.body | |
if (!body) { | |
await showError("No body found") | |
exit() | |
} | |
await editor({ | |
input: body, | |
width: 1200, | |
height: 900, | |
async onSubmit(data) { | |
await gh.issues.update({ ...ISSUE, body: data! }) | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment