aboutsummaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-09-21 18:08:48 -0400
committerJoe Mou <dev@mou.fo>2026-09-25 01:43:53 -0400
commitfd1c054c3c10dceb1a8a355c74a0d9e9077aae19 (patch)
treef0f17b19feb6496fef629dfa4af3db72ed249d13 /src/app.ts
parent499bba129c842c00c1a28d85bc044ab609aee44e (diff)
Add issue details
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/app.ts')
-rw-r--r--src/app.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/app.ts b/src/app.ts
index ec3680b..bed46f4 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -7,6 +7,7 @@ import {
getGitHubCommits,
getGitHubDiscussion,
getGitHubDiscussions,
+ getGitHubIssue,
getGitHubIssues,
getGitHubSidebar,
getGitHubLatestCommit,
@@ -214,6 +215,16 @@ export function createApp(eta: Eta) {
return c.render("issues.eta", await getGitHubIssues(owner, repo, { q }));
});
+ // GitHub puts its own actions (new, assigned, ...) where a number goes, so
+ // anything that isn't one is not an issue of ours to render.
+ app.get("/:owner/:repo/issues/:number", async (c) => {
+ const { owner, repo, number } = c.req.param();
+ if (!/^\d+$/.test(number)) {
+ return redirectToGitHub(c);
+ }
+ return c.render("issue.eta", await getGitHubIssue(owner, repo, Number(number)));
+ });
+
app.get("/:owner/:repo/pulls", async (c) => {
const { owner, repo } = c.req.param();
const q = c.req.query("q");