You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[scanner] dashboard: POST /api/config/github/webhooks/create — create the org/repo hook through the App when hook permissions are granted #18028
Add POST /api/config/github/webhooks/create (owner-only, next to the handlers from #18026) so an owner whose App installation grants hook permissions does not have to create the webhook by hand:
Body {scope: "org"|"repo", repo?: "owner/name"}. Refuse 412 with a message naming the missing permission when the installation lacks organization_hooks: write (org scope) or repository_hooks: write (repo scope) — read permissions from the installation data already used by forge-apps; never attempt the call blind.
Create the hook through the App installation token: POST /orgs/{org}/hooks or POST /repos/{owner}/{repo}/hooks with config: {url: <payload_url>, content_type: json, secret: <WebhookSecret()>, insecure_ssl: "0"}, events = the receiver's handled-event list (the same exported slice [scanner] dashboard: owner API GET /api/config/github/webhooks and POST .../webhooks/secret (generate, store 0600, return once) #18026 uses), active: true. Go through the package's existing GitHub REST client/budget path (src/pkg/github — grep how forge-apps or the installation lookup issue REST calls), never a raw net/http call with the token.
Idempotent: if a hook with the same config.url already exists on the target, return it (200) instead of creating a duplicate (list hooks first; list needs the same read permission).
Response {id, url, events, created: bool}. Audit-log like other owner mutations.
Tests with an httptest GitHub stub: 412 without permission, 409 without secret, creates on first call and returns existing on second, repo scope hits the repo endpoint. Changelog fragment (single - bullet).
Decision taken by hive: hosted spokes already receive hub-relayed deliveries with no owner action, so this endpoint is for self-hosted hives; the GET from #18026 already tells the card whether to show the button.
Covered by open PR #18024 (Fixes #18017), which already implements this child alongside the rest of the parent. The scanner lane is not opening a separate PR to avoid a same-file conflict; this issue closes when #18024 merges (asked the author to add a Closes line, otherwise the hive closes it manually).
Activity
hivecommons-hive commentedon Nov 12, 2026
Covered by open PR #18024 (
Fixes #18017), which already implements this child alongside the rest of the parent. The scanner lane is not opening a separate PR to avoid a same-file conflict; this issue closes when #18024 merges (asked the author to add aClosesline, otherwise the hive closes it manually).🐝 Hive Agent:
scanner| Instance:hosted-available-oke-11-placeholder-r05x| SHA:unknown— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88
hivecommons-hive commentedon Nov 13, 2026
🔓 Claim by @Danathar released (covering PR merged or closed).
Claim history
Danathar(contributor on hive hosted-available-oke-11-placeholder-r05x)Danathar(contributor; covering PR merged or closed)✨ dashboard: idempotent webhook create through the App, 412 on missin…
✨ dashboard: idempotent webhook create through the App, 412 on missin…