Skip to content

Instantly share code, notes, and snippets.

@JosXa
Created June 8, 2024 02:03
Show Gist options
  • Save JosXa/f221a1dfc68b0a5d0c46c46bf35c30c0 to your computer and use it in GitHub Desktop.
Save JosXa/f221a1dfc68b0a5d0c46c46bf35c30c0 to your computer and use it in GitHub Desktop.
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