fix(router): require clownfish automerge command
This commit is contained in:
parent
6c1fe749a3
commit
9885ef4ae6
@ -113,8 +113,6 @@ export function buildAutomergeMergeArgs({ issueNumber, repo, expectedHeadSha })
|
||||
|
||||
export function parseCommand(body) {
|
||||
for (const line of String(body ?? "").split(/\r?\n/)) {
|
||||
const automerge = line.match(/^\s*\/automerge\s*$/i);
|
||||
if (automerge) return commandFromText("slash", "automerge");
|
||||
const autoclose = line.match(/^\s*\/autoclose(?:\s+(.+))?\s*$/i);
|
||||
if (autoclose) return commandFromText("slash", `autoclose ${autoclose[1] ?? ""}`.trim());
|
||||
const slash = line.match(/^\s*\/clownfish(?:\s+(.+))?\s*$/i);
|
||||
|
||||
@ -40,11 +40,7 @@ test("parseCommand recognizes maintainer slash commands", () => {
|
||||
command: "automerge",
|
||||
intent: "automerge",
|
||||
});
|
||||
assert.deepEqual(parseCommand("/automerge"), {
|
||||
trigger: "slash",
|
||||
command: "automerge",
|
||||
intent: "automerge",
|
||||
});
|
||||
assert.equal(parseCommand("/automerge"), null);
|
||||
assert.deepEqual(parseCommand("/autoclose We do not plan to support this feature"), {
|
||||
trigger: "slash",
|
||||
command: "autoclose we do not plan to support this feature",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user