aboutsummaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
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");