Merge pull request 'Document Gitea webhook setup and fix log file sorting' (#15) from probablycorey/pr-to-discord-flow into main
Some checks are pending
CI / test (push) Waiting to run

Reviewed-on: #15
This commit is contained in:
probablycorey 2026-03-10 18:02:49 +00:00
commit 2943f24c17
2 changed files with 14 additions and 3 deletions

View File

@ -10,7 +10,15 @@ Discord-Gitea bridge bot. When someone opens a PR or leaves a comment on [git.no
4. `bun run subdomain:dev` to start the server.
5. Visit `localhost:3000/discord/auth` to authorize the bot to your Discord server.
6. Use [Tailscale Funnel](https://tailscale.com/kb/1223/funnel) or ngrok to expose your local server to the internet.
7. Add a Gitea webhook at `https://git.nose.space/<org>/settings/hooks` pointing to `https://<your-tunnel>/gitea/webhook`.
7. Add a Gitea webhook (see below).
### Gitea webhook
Spike needs a webhook so Gitea sends PR and comment events to it. You have two options:
**System webhook (covers all repos)** — Requires Gitea admin access. Go to **Site Administration > System Webhooks > Add Webhook > Gitea**. Set the target URL to `https://spike.theworkshop.cc/gitea/webhook`. Under "Trigger On", select **Custom Events** and enable Pull Request, Issue Comment, and Pull Request Comment. This fires for every repo on the instance.
**Org/repo webhook (covers one org or repo)** — Go to the org or repo settings, then **Webhooks > Add Webhook > Gitea**. Same target URL and event configuration as above. Only fires for that org or repo.
### Environment variables

View File

@ -86,20 +86,23 @@ function EventRow({ event, index }: { event: StoredLogEvent; index: number }) {
}
function Sidebar({ files, selectedFile }: { files: string[]; selectedFile?: string }) {
// Group files by sha
// Group files by sha, sorted by most recent file in each group
const grouped: Record<string, string[]> = {}
for (const file of files) {
const sha = file.split("_")[0] || "unknown"
const list = grouped[sha] || (grouped[sha] = [])
list.push(file)
}
const sortedGroups = Object.entries(grouped).sort(([, a], [, b]) => {
return b[0]!.localeCompare(a[0]!)
})
return (
<nav style="width: 280px; min-width: 280px; background: #141414; border-right: 1px solid #2a2a2a; overflow-y: auto; padding: 16px 0">
<div style="padding: 0 16px 12px; color: #9ca3af; font-size: 11px; text-transform: uppercase; letter-spacing: 1px">
Log Files
</div>
{Object.entries(grouped).map(([sha, shaFiles]) => (
{sortedGroups.map(([sha, shaFiles]) => (
<div style="margin-bottom: 8px">
<div style="padding: 4px 16px; color: #6b7280; font-size: 11px; font-family: monospace">{sha}</div>
{shaFiles.map((file) => {