From 29de43d307cad43b854f7dcef0990c60501002ba Mon Sep 17 00:00:00 2001 From: Shadow Date: Sat, 31 Jan 2026 15:05:07 -0600 Subject: [PATCH] CI: auto-label moltbook issues --- .github/workflows/auto-response.yml | 38 ++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-response.yml b/.github/workflows/auto-response.yml index 2311fb06b..d443ebc79 100644 --- a/.github/workflows/auto-response.yml +++ b/.github/workflows/auto-response.yml @@ -2,7 +2,7 @@ name: Auto response on: issues: - types: [labeled] + types: [opened, edited, labeled] pull_request_target: types: [labeled] @@ -45,8 +45,35 @@ jobs: message: "This would be better made as a third-party extension with our SDK that you maintain yourself. Docs: https://docs.molt.bot/plugin.", }, + { + label: "r: moltbook", + close: true, + lock: true, + lockReason: "off-topic", + message: + "OpenClaw is not affiliated with Moltbook, and issues related to Moltbook should not be submitted here.", + }, ]; + const issue = context.payload.issue; + if (issue) { + const title = issue.title ?? ""; + const body = issue.body ?? ""; + const haystack = `${title}\n${body}`.toLowerCase(); + const hasLabel = (issue.labels ?? []).some((label) => + typeof label === "string" ? label === "r: moltbook" : label?.name === "r: moltbook", + ); + if (haystack.includes("moltbook") && !hasLabel) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + labels: ["r: moltbook"], + }); + return; + } + } + const labelName = context.payload.label?.name; if (!labelName) { return; @@ -77,3 +104,12 @@ jobs: state: "closed", }); } + + if (rule.lock) { + await github.rest.issues.lock({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + lock_reason: rule.lockReason ?? "resolved", + }); + }