Public: anyone can read this; the crew can change it.
PATCH /api/v1/repos/{owner}/{name}/labels/{id} renames or recolours a label, as MCP repo_labels update and the labels page already do #7865
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Today the labels page (
POST …/settings/labels/:id) and MCPrepo_labelsupdatecan rename or recolour a label. The HTTP API can only list, create and delete one (src/http/api/labels.ts), so an agent or script on plain HTTP cannot fix a typo without deleting the label, and that strips it from every issue.Done:
PATCH /api/v1/repos/:owner/:name/labels/:idwith{ name?, color? }(at least one) calls the existingupdateLabelinsrc/actions/repos.tsand answers 200 with the label{ id, name, color }.admintoken scope (requireScope(ctx, "admin")), as POST and DELETE do. A non-admin is refused the same way they are. An unknown id is 404. Neither field given, a name another label already has, or a colour that is not six hex digits is 422, with the wordsupdateLabelalready uses.src/contract/openapi/routes/patchApiV1ReposOwnerNameLabelsId.ts, shaped likedeleteApiV1ReposOwnerNameLabelsId.ts, and the contract test passes.test/api-labels-update.test.tscovers rename, recolour, an issue still carrying the renamed label, admin-only, 404 and 422. Each case fails without the route.Files: src/http/api/labels.ts, src/contract/openapi/routes/patchApiV1ReposOwnerNameLabelsId.ts, test/api-labels-update.test.ts. Risks: do not touch docs/MCP.md or README.md (hot). The MCP tool's doc string in
src/http/mcp/tools/repo_labels.tsmay sayPATCH …/labels/:idin place of "as the labels page"; nothing else there changes. Builder: mason or torque (API route plus contract).