fix(ci): exempt automation PRs from Barnacle PR limit · openclaw/openclaw@fdf8ffa
vincentkoc
·
2026-04-30
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -375,10 +375,12 @@ jobs:
|
375 | 375 | return false; |
376 | 376 | }; |
377 | 377 | |
378 | | - const isClawsweeperPullRequest = |
379 | | - typeof headRefName === "string" && headRefName.startsWith("clawsweeper/"); |
| 378 | + const automationPrHeadPrefixes = ["clawsweeper/", "clownfish/"]; |
| 379 | + const isAutomationPullRequest = |
| 380 | + typeof headRefName === "string" && |
| 381 | + automationPrHeadPrefixes.some((prefix) => headRefName.startsWith(prefix)); |
380 | 382 | |
381 | | - if ((await isPrivilegedAuthor()) || isClawsweeperPullRequest) { |
| 383 | + if ((await isPrivilegedAuthor()) || isAutomationPullRequest) { |
382 | 384 | if (labelNames.has(activePrLimitLabel)) { |
383 | 385 | try { |
384 | 386 | await github.rest.issues.removeLabel({ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -237,10 +237,14 @@ const candidateActionRules = [
|
237 | 237 | ]; |
238 | 238 | |
239 | 239 | const normalizeLogin = (login) => login.toLowerCase(); |
| 240 | +const automationPrHeadPrefixes = ["clawsweeper/", "clownfish/"]; |
240 | 241 | |
241 | | -export function isClawsweeperPullRequest(pullRequest) { |
| 242 | +export function isAutomationPullRequest(pullRequest) { |
242 | 243 | const headRefName = pullRequest.headRefName ?? pullRequest.head?.ref ?? ""; |
243 | | -return typeof headRefName === "string" && headRefName.startsWith("clawsweeper/"); |
| 244 | +return ( |
| 245 | +typeof headRefName === "string" && |
| 246 | +automationPrHeadPrefixes.some((prefix) => headRefName.startsWith(prefix)) |
| 247 | +); |
244 | 248 | } |
245 | 249 | |
246 | 250 | export function extractIssueFormValue(body, field) { |
@@ -1031,7 +1035,7 @@ export async function runBarnacleAutoResponse({ github, context, core = console
|
1031 | 1035 | if (pullRequest && labelSet.has(activePrLimitOverrideLabel)) { |
1032 | 1036 | labelSet.delete(activePrLimitLabel); |
1033 | 1037 | } |
1034 | | -if (pullRequest && isClawsweeperPullRequest(pullRequest)) { |
| 1038 | +if (pullRequest && isAutomationPullRequest(pullRequest)) { |
1035 | 1039 | await removeLabels(github, context, pullRequest.number, [activePrLimitLabel], labelSet); |
1036 | 1040 | } |
1037 | 1041 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -290,20 +290,26 @@ describe("barnacle-auto-response", () => {
|
290 | 290 | ); |
291 | 291 | }); |
292 | 292 | |
293 | | -it("does not close ClawSweeper PRs for the active PR limit", async () => { |
294 | | -for (const headRef of [ |
295 | | -{ head: { ref: "clawsweeper/openclaw-openclaw-73880" } }, |
296 | | -{ headRefName: "clawsweeper/openclaw-openclaw-73880" }, |
| 293 | +it("does not close automation PRs for the active PR limit", async () => { |
| 294 | +for (const automationPullRequest of [ |
| 295 | +{ head: { ref: "clawsweeper/openclaw-openclaw-73880" }, login: "app/openclaw-clawsweeper" }, |
| 296 | +{ headRefName: "clawsweeper/openclaw-openclaw-73880", login: "app/openclaw-clawsweeper" }, |
| 297 | +{ |
| 298 | +head: { ref: "clownfish/ghcrawl-156993-autonomous-smoke" }, |
| 299 | +login: "app/openclaw-clownfish", |
| 300 | +}, |
| 301 | +{ headRefName: "clownfish/ghcrawl-156993-autonomous-smoke", login: "app/openclaw-clownfish" }, |
297 | 302 | ]) { |
298 | 303 | const { calls, github } = barnacleGithub([]); |
| 304 | +const { login, ...pullRequest } = automationPullRequest; |
299 | 305 | |
300 | 306 | await runBarnacleAutoResponse({ |
301 | 307 | github, |
302 | 308 | context: barnacleContext( |
303 | 309 | { |
304 | | - ...headRef, |
| 310 | + ...pullRequest, |
305 | 311 | user: { |
306 | | -login: "app/openclaw-clawsweeper", |
| 312 | + login, |
307 | 313 | }, |
308 | 314 | }, |
309 | 315 | ["r: too-many-prs"], |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。