@buddysh/buddy 0.11.10 → 0.11.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/bin/cli.js +19 -19
- package/dist/{chunk-p9z0hzej.js → chunk-08daxhzx.js} +2 -2
- package/dist/{chunk-ja3rvd6y.js → chunk-0f1xye20.js} +1 -1
- package/dist/{chunk-be059ncv.js → chunk-0g4ybxwj.js} +2 -2
- package/dist/{chunk-2m0134q8.js → chunk-0m1z85m9.js} +1 -1
- package/dist/chunk-0m6b7bac.js +2 -0
- package/dist/{chunk-6xzzs109.js → chunk-0rbxek2f.js} +2 -2
- package/dist/chunk-0sm25gee.js +2 -0
- package/dist/chunk-11p0az6f.js +2 -0
- package/dist/{chunk-xny4kgcc.js → chunk-142zh7e5.js} +1 -1
- package/dist/chunk-16fr8xqp.js +2 -0
- package/dist/{chunk-jpdd59fh.js → chunk-1pecmenc.js} +1 -1
- package/dist/chunk-1w1h2tsf.js +2 -0
- package/dist/{chunk-nwrr6jas.js → chunk-1xe0960b.js} +2 -2
- package/dist/chunk-225s199d.js +2 -0
- package/dist/{chunk-a34szd4r.js → chunk-24xnjkvz.js} +3 -3
- package/dist/{chunk-emygmh7r.js → chunk-24xvskkf.js} +1 -1
- package/dist/{chunk-6wxwewbh.js → chunk-2e4e6zjs.js} +1 -1
- package/dist/{chunk-7bctsv0x.js → chunk-2hb8dan0.js} +1 -1
- package/dist/{chunk-z21tw4fz.js → chunk-2jjrxgs1.js} +2 -2
- package/dist/chunk-2z2gh050.js +44 -0
- package/dist/{chunk-6k6dgwmy.js → chunk-2z9pkk1y.js} +1 -1
- package/dist/{chunk-9m0epv44.js → chunk-33h1me7n.js} +2 -2
- package/dist/{chunk-khn11t39.js → chunk-3c114myc.js} +1 -1
- package/dist/{chunk-xffrrs85.js → chunk-3n4w3ak9.js} +11 -11
- package/dist/{chunk-rg996jqw.js → chunk-40pvn33p.js} +1 -1
- package/dist/{chunk-k3x0mabj.js → chunk-42xvqxdw.js} +2 -2
- package/dist/{chunk-1m5wprvm.js → chunk-54er1whp.js} +2 -2
- package/dist/{chunk-y7z0br2x.js → chunk-59993g25.js} +1 -1
- package/dist/{chunk-7crh00m7.js → chunk-5jvde2as.js} +2 -2
- package/dist/{chunk-y9senfb6.js → chunk-5pheqk23.js} +1 -1
- package/dist/{chunk-drkzf2gz.js → chunk-62j8q7sg.js} +1 -1
- package/dist/chunk-64kt1w23.js +2 -0
- package/dist/{chunk-4akhxmfk.js → chunk-65by8f14.js} +1 -1
- package/dist/chunk-6gdenphk.js +2 -0
- package/dist/{chunk-gzjxhd7a.js → chunk-750ae48c.js} +2 -2
- package/dist/{chunk-mdbf728w.js → chunk-77qe887p.js} +1 -1
- package/dist/{chunk-mg3em5qj.js → chunk-7b4jsg36.js} +2 -2
- package/dist/{chunk-hkb714k3.js → chunk-7c1284fb.js} +1 -1
- package/dist/chunk-7m1ab6p8.js +2 -0
- package/dist/{chunk-bggpgbdx.js → chunk-7m3pzkcj.js} +1 -1
- package/dist/chunk-81y75fg7.js +2 -0
- package/dist/{chunk-04qvf24t.js → chunk-89jytkd6.js} +1 -1
- package/dist/{chunk-bjymeq7e.js → chunk-8swwcx7w.js} +1 -1
- package/dist/{chunk-yxb1jwxp.js → chunk-9sdgy9nm.js} +2 -2
- package/dist/chunk-a30cyqr0.js +2 -0
- package/dist/{chunk-ysgex7h7.js → chunk-a3zgenkh.js} +1 -1
- package/dist/chunk-a56s1xrt.js +2 -0
- package/dist/{chunk-7ds5q6j3.js → chunk-apdrg3r7.js} +1 -1
- package/dist/chunk-axazt516.js +2 -0
- package/dist/{chunk-88xaexj1.js → chunk-b3s185kp.js} +1 -1
- package/dist/chunk-b59zbkfx.js +2 -0
- package/dist/{chunk-a3bnhq58.js → chunk-b9szrnxw.js} +1 -1
- package/dist/{chunk-89s9f3mf.js → chunk-bnp0r4eh.js} +1 -1
- package/dist/{chunk-se4g70q2.js → chunk-bsh3kp53.js} +1 -1
- package/dist/{chunk-k7x9af5r.js → chunk-c6ptrc0v.js} +2 -2
- package/dist/{chunk-vckn5ate.js → chunk-cj4d5ad7.js} +1 -1
- package/dist/{chunk-6w8vxy7s.js → chunk-cm6devhe.js} +1 -1
- package/dist/{chunk-34rmja4x.js → chunk-ctdfppxk.js} +2 -2
- package/dist/{chunk-jxd64dzs.js → chunk-cvwkdfvr.js} +1 -1
- package/dist/{chunk-amj037yy.js → chunk-d4gk9awk.js} +3 -3
- package/dist/{chunk-61gfjcqt.js → chunk-dd895pm0.js} +1 -1
- package/dist/{chunk-h8e796qs.js → chunk-ddky3026.js} +1 -1
- package/dist/{chunk-rrnvxj90.js → chunk-dsnd6ndd.js} +1 -1
- package/dist/{chunk-3waqfh3y.js → chunk-enq0gm64.js} +2 -2
- package/dist/{chunk-pmszvhja.js → chunk-esm5jjgf.js} +1 -1
- package/dist/chunk-esveeark.js +2 -0
- package/dist/chunk-ffbbc38r.js +2 -0
- package/dist/{chunk-fpzgxg8a.js → chunk-fmkb816y.js} +1 -1
- package/dist/chunk-g4803nvq.js +2 -0
- package/dist/{chunk-kh6v93yb.js → chunk-gpjde0j6.js} +2 -2
- package/dist/{chunk-4wbbbcs2.js → chunk-gweqk008.js} +2 -2
- package/dist/{chunk-kpdz73mc.js → chunk-hc651afv.js} +1 -1
- package/dist/{chunk-88j356ng.js → chunk-j46f90n8.js} +1 -1
- package/dist/chunk-jhz202wk.js +2 -0
- package/dist/{chunk-1szfwcst.js → chunk-jqh7vx2n.js} +1 -1
- package/dist/{chunk-qdmr84mc.js → chunk-k3r7v3dp.js} +2 -2
- package/dist/{chunk-s3ksf6s5.js → chunk-kbvj6qxc.js} +1 -1
- package/dist/{chunk-gvnsr72j.js → chunk-knpdntnh.js} +1 -1
- package/dist/chunk-kq0n3x2e.js +2 -0
- package/dist/{chunk-ktmgq0ja.js → chunk-ktn47bq8.js} +1 -1
- package/dist/chunk-ktzvchps.js +2 -0
- package/dist/chunk-m1zv8db4.js +2 -0
- package/dist/{chunk-d7jpbw1z.js → chunk-mt53v4sx.js} +1 -1
- package/dist/{chunk-90q6r1j7.js → chunk-nbyxgt9c.js} +1 -1
- package/dist/chunk-njrezpsw.js +2 -0
- package/dist/{chunk-gyf7psxg.js → chunk-nkztawjh.js} +1 -1
- package/dist/chunk-pegk4jhq.js +2 -0
- package/dist/{chunk-q90s02qc.js → chunk-q7y8dvbz.js} +1 -1
- package/dist/{chunk-wjmp2hsj.js → chunk-qdr900z7.js} +1 -1
- package/dist/chunk-rphwf28s.js +2 -0
- package/dist/chunk-rr8apsh5.js +2 -0
- package/dist/{chunk-db9rffcf.js → chunk-rxf8h1e5.js} +1 -1
- package/dist/{chunk-jj1gjkb7.js → chunk-ry5zh9cx.js} +1 -1
- package/dist/{chunk-785rgtn5.js → chunk-rygtb1x3.js} +5 -5
- package/dist/chunk-s1cgwkkr.js +3 -0
- package/dist/{chunk-7rjrea9g.js → chunk-sxfk3naz.js} +2 -2
- package/dist/chunk-tjvvb919.js +2 -0
- package/dist/chunk-tzmj8w3x.js +2 -0
- package/dist/{chunk-tx9m7y1z.js → chunk-v0y8eens.js} +2 -2
- package/dist/chunk-v9fnbdgr.js +2 -0
- package/dist/{chunk-ggzjv4s0.js → chunk-va3k91tf.js} +1 -1
- package/dist/{chunk-hdqmcp3n.js → chunk-vmt1bed1.js} +1 -1
- package/dist/chunk-vpsvtb9v.js +2 -0
- package/dist/{chunk-pxdrwhxx.js → chunk-vpw7adwd.js} +1 -1
- package/dist/{chunk-8tsw3cjk.js → chunk-vs68hsbp.js} +1 -1
- package/dist/{chunk-2145m12g.js → chunk-vtr2vbk0.js} +1 -1
- package/dist/{chunk-4hd1mryc.js → chunk-w55x2g9n.js} +2 -2
- package/dist/{chunk-hyp0wfta.js → chunk-wjfw6rx8.js} +2 -2
- package/dist/chunk-wt83nzn3.js +2 -0
- package/dist/{chunk-8dj94fsy.js → chunk-x1w6q9tk.js} +1 -1
- package/dist/{chunk-s3q7g2hy.js → chunk-xqveh8a5.js} +1 -1
- package/dist/chunk-xxwevpnr.js +2 -0
- package/dist/{chunk-wd8w0vjs.js → chunk-y3w8h4sy.js} +1 -1
- package/dist/{chunk-4c3dws2k.js → chunk-ycbk7tg9.js} +1 -1
- package/dist/chunk-yf01hyxn.js +2 -0
- package/dist/{chunk-srz5kgyg.js → chunk-yqfwvk9z.js} +1 -1
- package/dist/{chunk-0apd8zqn.js → chunk-z05djfac.js} +7 -7
- package/dist/{chunk-kpqez1ht.js → chunk-z18bksyr.js} +1 -1
- package/dist/{chunk-1tg7dfq5.js → chunk-zk8zdv23.js} +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/setup.js +1 -1
- package/dist/src/utils/lock-file.d.ts +19 -0
- package/package.json +1 -1
- package/dist/chunk-00vbhh0z.js +0 -2
- package/dist/chunk-0y706m2d.js +0 -2
- package/dist/chunk-1aee33aa.js +0 -2
- package/dist/chunk-1vhqtq6m.js +0 -2
- package/dist/chunk-2fx0tbc0.js +0 -2
- package/dist/chunk-3ggd7z2f.js +0 -2
- package/dist/chunk-3xbx315d.js +0 -2
- package/dist/chunk-4k9f9vn2.js +0 -2
- package/dist/chunk-4zvjzesh.js +0 -2
- package/dist/chunk-5dw0q5ng.js +0 -2
- package/dist/chunk-5qtdc2mb.js +0 -2
- package/dist/chunk-6gttmvww.js +0 -2
- package/dist/chunk-7f6mpphq.js +0 -2
- package/dist/chunk-7mmdxbcm.js +0 -2
- package/dist/chunk-7ze1qrmt.js +0 -2
- package/dist/chunk-9634xcvq.js +0 -2
- package/dist/chunk-97csq21c.js +0 -2
- package/dist/chunk-ea6rtyvy.js +0 -2
- package/dist/chunk-gs5b2ssa.js +0 -2
- package/dist/chunk-gw69sjx2.js +0 -2
- package/dist/chunk-j0fcqty9.js +0 -2
- package/dist/chunk-kszbmpw1.js +0 -2
- package/dist/chunk-mzb7cg8a.js +0 -2
- package/dist/chunk-pjq0qxst.js +0 -2
- package/dist/chunk-pksrcdh6.js +0 -2
- package/dist/chunk-tf9nqr0p.js +0 -2
- package/dist/chunk-tq1w2wwa.js +0 -2
- package/dist/chunk-w93akf6h.js +0 -2
- package/dist/chunk-wreexgkb.js +0 -44
- package/dist/chunk-x5jfh372.js +0 -2
- package/dist/chunk-ydt2sn0j.js +0 -2
- package/dist/chunk-z0qbkvyz.js +0 -2
- package/dist/chunk-zefqbamj.js +0 -2
- package/dist/chunk-zrg5ss0x.js +0 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{X as
|
|
2
|
+
import{Eh as V}from"./chunk-vpw7adwd.js";import{Jh as M}from"./chunk-b9szrnxw.js";import{Mh as K,Ph as Q}from"./chunk-x1w6q9tk.js";class X{token;apiUrl;logger;slug;constructor(j,z,A,C,F){this.token=j;this.apiUrl=(C??"https://api.bitbucket.org/2.0").replace(/\/+$/,""),this.logger=F??Q(),this.slug=`${encodeURIComponent(z)}/${encodeURIComponent(A)}`}capabilities(){return{pinIssues:!1,checkRuns:!0,inlineReviewComments:!0,reviewSuggestions:!1,nativeAutoMerge:!1,commentReactions:!1,ciLogs:!1,ciRuns:!1,reviewThreads:!1,teamReviewers:!1,draftPullRequests:!1,permissionLookup:!0,branchHousekeeping:!0,reopenPullRequests:!1,labels:!1}}async request(j,z,A,C={}){let F={Authorization:`Bearer ${this.token}`,Accept:C.raw?"text/plain":"application/json","User-Agent":"buddy"},H;if(C.form)F["Content-Type"]="application/x-www-form-urlencoded",H=new URLSearchParams(C.form).toString();else if(A)F["Content-Type"]="application/json",H=JSON.stringify(A);let G=await M(`${this.apiUrl}${z}`,{method:j,headers:F,...H?{body:H}:{}});if(!G.ok){let J=await G.text().catch(()=>"");throw Error(`Bitbucket ${j} ${z} failed: ${G.status} ${J.slice(0,200)}`)}let I=await G.text();if(C.raw)return I;return I.trim()?JSON.parse(I):void 0}async optional(j,z){try{return await this.request(j,z)}catch(A){if(String(A).includes("404"))return null;throw A}}async collect(j,z=10){let A=[],C=`${this.apiUrl}${j}`;for(let F=0;F<z&&C;F++){let H=C,G=await this.optional("GET",H.startsWith(this.apiUrl)?H.slice(this.apiUrl.length):H);if(!G)break;A.push(...G.values??[]),C=G.next}return A}async branchExists(j){return await this.optional("GET",`/repositories/${this.slug}/refs/branches/${encodeURIComponent(j)}`)!==null}async createBranch(j,z){await this.request("POST",`/repositories/${this.slug}/refs/branches`,{name:j,target:{hash:z}})}async deleteBranch(j){await this.request("DELETE",`/repositories/${this.slug}/refs/branches/${encodeURIComponent(j)}`)}async commitChanges(j,z,A,C="main"){if(A.length===0)return;let F={message:z,branch:j};for(let I of A)if(I.type==="delete")F.files=F.files?`${F.files},${I.path}`:I.path;else F[I.path]=I.content;let H=new URLSearchParams;for(let[I,J]of Object.entries(F)){if(I==="files")continue;H.append(I,J)}for(let I of A)if(I.type==="delete")H.append("files",I.path);let G=await this.headOf(C);if(G)H.append("parents",G);await this.request("POST",`/repositories/${this.slug}/src`,void 0,{form:Object.fromEntries(H.entries())})}async headOf(j){return(await this.optional("GET",`/repositories/${this.slug}/refs/branches/${encodeURIComponent(j)}`))?.target?.hash??null}async getFileContent(j,z){try{return await this.request("GET",`/repositories/${this.slug}/src/${encodeURIComponent(z)}/${j}`,void 0,{raw:!0})}catch(A){if(String(A).includes("404"))return null;throw A}}async createPullRequest(j){if(j.draft)this.logger.debug("Bitbucket has no draft pull requests; opening as ready");let z=await this.request("POST",`/repositories/${this.slug}/pullrequests`,{title:j.title,description:j.body,source:{branch:{name:j.head}},destination:{branch:{name:j.base}},close_source_branch:!0,...j.reviewers?.length?{reviewers:j.reviewers.map((A)=>({nickname:A}))}:{}});return this.toPullRequest(z)}async getPullRequests(j="open"){let A=(j==="open"?["OPEN"]:j==="closed"?["MERGED","DECLINED","SUPERSEDED"]:["OPEN","MERGED","DECLINED","SUPERSEDED"]).map((F)=>`state=${F}`).join("&");return(await this.collect(`/repositories/${this.slug}/pullrequests?${A}&pagelen=50`)).map((F)=>this.toPullRequest(F))}async updatePullRequest(j,z){let A=await this.request("PUT",`/repositories/${this.slug}/pullrequests/${j}`,{...z.title!==void 0?{title:z.title}:{},...z.body!==void 0?{description:z.body}:{},...z.base!==void 0?{destination:{branch:{name:z.base}}}:{}});return this.toPullRequest(A)}async closePullRequest(j){await this.request("POST",`/repositories/${this.slug}/pullrequests/${j}/decline`)}async reopenPullRequest(j){throw Error(`Bitbucket cannot reopen declined pull request #${j}; open a new one from the same branch.`)}async mergePullRequest(j,z="squash"){let A={merge:"merge_commit",squash:"squash",rebase:"fast_forward"};await this.request("POST",`/repositories/${this.slug}/pullrequests/${j}/merge`,{merge_strategy:A[z]??"squash",close_source_branch:!0})}async getPullRequestDiff(j){return await this.request("GET",`/repositories/${this.slug}/pullrequests/${j}/diff`,void 0,{raw:!0})}async getPullRequestHeadSha(j){return(await this.request("GET",`/repositories/${this.slug}/pullrequests/${j}`)).source?.commit?.hash??""}async createComment(j,z){await this.request("POST",`/repositories/${this.slug}/pullrequests/${j}/comments`,{content:{raw:z}})}async createIssue(j){let z=await this.request("POST",`/repositories/${this.slug}/issues`,{title:j.title,content:{raw:j.body},kind:"task"});return this.toIssue(z)}async getIssues(j="open"){let A=(await this.collect(`/repositories/${this.slug}/issues?pagelen=50`)).map((C)=>this.toIssue(C));return j==="all"?A:A.filter((C)=>C.state===j)}async updateIssue(j,z){let A=await this.request("PUT",`/repositories/${this.slug}/issues/${j}`,{...z.title!==void 0?{title:z.title}:{},...z.body!==void 0?{content:{raw:z.body}}:{}});return this.toIssue(A)}async closeIssue(j){await this.request("PUT",`/repositories/${this.slug}/issues/${j}`,{state:"closed"})}async unpinIssue(j){return!1}async getPullRequestChecksState(j){let z=await this.getPullRequestHeadSha(j);if(!z)return"none";let A=await this.collect(`/repositories/${this.slug}/commit/${z}/statuses?pagelen=50`);if(A.length===0)return"none";if(A.some((C)=>C.state==="FAILED"||C.state==="STOPPED"))return"failure";if(A.some((C)=>C.state==="INPROGRESS"))return"pending";if(A.every((C)=>C.state==="SUCCESSFUL"))return"success";return"pending"}async createReview(j,z){if(await this.createComment(j,z.body),!z.comments?.length)return{posted:!0,inlineComments:0};let A=0;for(let C of z.comments)try{await this.request("POST",`/repositories/${this.slug}/pullrequests/${j}/comments`,{content:{raw:C.body},inline:{path:C.path,...C.side==="RIGHT"?{to:C.line}:{from:C.line}}}),A++}catch(F){this.logger.debug(`Could not place a comment on ${C.path}:${C.line}: ${K(F)}`)}return{posted:!0,inlineComments:A}}async createCheckRun(j,z,A){try{await this.request("POST",`/repositories/${this.slug}/commit/${z}/statuses/build`,{key:j.replace(/[^\w-]/g,"-").slice(0,40),state:A.conclusion==="failure"?"FAILED":"SUCCESSFUL",name:A.title.slice(0,100),description:A.summary.slice(0,300),url:"https://buddy.sh"})}catch(C){this.logger.warn(`\u26A0\uFE0F Could not report build status ${j}: ${K(C)}`)}}async hasWriteAccess(j){let A=(await this.optional("GET",`/repositories/${this.slug}/permissions-config/users`))?.values?.find((C)=>C.user?.nickname===j);return A?.permission==="write"||A?.permission==="admin"}async getBuddyBranches(){return(await this.collect(`/repositories/${this.slug}/refs/branches?q=${encodeURIComponent('name ~ "buddy/"')}&pagelen=50`)).filter((z)=>V(z.name)).map((z)=>({name:z.name,sha:z.target?.hash??"",lastCommitDate:z.target?.date?new Date(z.target.date):new Date(0)}))}async getOrphanedBuddyBranches(){let[j,z]=await Promise.all([this.getBuddyBranches(),this.getPullRequests("open")]),A=new Set(z.map((C)=>C.head));return j.filter((C)=>!A.has(C.name))}async cleanupStaleBranches(j=7,z=!1){let A=new Date(Date.now()-j*24*60*60*1000),C=(await this.getOrphanedBuddyBranches()).filter((G)=>G.lastCommitDate<A);if(z)return{deleted:C.map((G)=>G.name),failed:[]};let F=[],H=[];for(let G of C)try{await this.deleteBranch(G.name),F.push(G.name)}catch{H.push(G.name)}return{deleted:F,failed:H}}toPullRequest(j){let z=j.state==="MERGED"?"merged":j.state==="OPEN"?"open":"closed";return{number:j.id,title:j.title,body:j.description??"",head:j.source?.branch?.name??"",base:j.destination?.branch?.name??"",state:z,url:j.links?.html?.href??"",createdAt:new Date(j.created_on),updatedAt:new Date(j.updated_on),...z==="merged"?{mergedAt:new Date(j.updated_on)}:{},author:j.author?.nickname??j.author?.display_name??"",reviewers:(j.reviewers??[]).map((A)=>A.nickname??A.display_name??"").filter(Boolean),assignees:[],labels:[],draft:!1}}toIssue(j){let z=["new","open","on hold"].includes(j.state);return{number:j.id,title:j.title,body:j.content?.raw??"",state:z?"open":"closed",url:j.links?.html?.href??"",createdAt:new Date(j.created_on),updatedAt:new Date(j.updated_on),...z?{}:{closedAt:new Date(j.updated_on)},author:j.reporter?.nickname??j.reporter?.display_name??"",assignees:[],labels:[]}}}
|
|
3
|
+
export{X as Dh};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Cb as a,Db as b}from"./chunk-xqveh8a5.js";import"./chunk-q2tjkhez.js";import"./chunk-5yfaptmp.js";import"./chunk-59993g25.js";import"./chunk-va3k91tf.js";import"./chunk-0g4ybxwj.js";import"./chunk-142zh7e5.js";import"./chunk-ctdfppxk.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.js";export{b as runReviewForPR,a as reviewPullRequest};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{existsSync as O,readdirSync as R,statSync as A}from"fs";import{join as U,relative as L}from"path";function T(z,K){try{let V=Bun.YAML.parse(K);if(!V||typeof V!=="object")return null;return{file:z,raw:K,data:V}}catch{return null}}function B(z,K){if(!K)return;let V=z.indexOf(K);if(V<0)return;let M=1;for(let Y=0;Y<V;Y++)if(z.charCodeAt(Y)===10)M++;return M}async function W(z){let K=U(z,".github","workflows");if(!O(K))return[];let V=R(K),M=[];for(let Y of V){if(!Y.endsWith(".yml")&&!Y.endsWith(".yaml"))continue;let Q=U(K,Y);if(!A(Q).isFile())continue;let Z=await Bun.file(Q).text(),N=T(L(z,Q),Z);if(N)M.push(N)}return M}function*X(z){let K=z.data.jobs;if(!K||typeof K!=="object")return;for(let[V,M]of Object.entries(K)){if(!M||typeof M!=="object")continue;let Y=M.steps;if(!Array.isArray(Y))continue;for(let Q=0;Q<Y.length;Q++){let Z=Y[Q];if(!Z||typeof Z!=="object")continue;yield{jobId:V,job:M,stepIndex:Q,step:Z}}}}function*$(z){let K=z.data.jobs;if(!K||typeof K!=="object")return;for(let[V,M]of Object.entries(K)){if(!M||typeof M!=="object")continue;yield{jobId:V,job:M}}}var F={id:"bash-injection",defaultSeverity:"error",description:"Avoid `${{ }}` interpolation of untrusted input inside `run:` blocks.",check(z){let K=[];for(let{jobId:V,step:M,stepIndex:Y}of X(z)){let Q=typeof M.run==="string"?M.run:null;if(!Q)continue;let Z=[...Q.matchAll(/\$\{\{\s*([^}]+?)\s*\}\}/g)];for(let N of Z){let C=N[1].trim();if(I(C))continue;K.push({ruleId:this.id,severity:this.defaultSeverity,message:`Job \`${V}\`, step ${Y+1}: \`${C}\` is interpolated into a shell.`,detail:"GitHub evaluates `${{ ... }}` before the shell runs, so attacker-controlled values become part of the command line. Move the value into `env:` and reference it as a shell variable.",file:z.file,line:B(z.raw,N[0]),fix:'Put the value in `env:` and reference it with `"$NAME"` instead.'})}}return K}},_=["secrets.","vars.","runner.","env.","inputs.","matrix.","strategy.","job.","steps.","needs."],S=new Set(["github.repository","github.repository_owner","github.workflow","github.run_id","github.run_number","github.run_attempt","github.event_name","github.sha","github.ref_name","github.token","github.actor","github.actor_id","github.api_url","github.server_url","github.graphql_url","github.workspace","github.action","github.action_path","github.action_ref","github.action_repository","github.action_status","github.job","github.job_workflow_sha"]);function I(z){if(S.has(z))return!0;return _.some((K)=>z.startsWith(K))}var J={id:"dangerous-pull-request-target",defaultSeverity:"error",description:"Avoid checking out PR-author code from a `pull_request_target` workflow.",check(z){if(!x(z.data.on,"pull_request_target"))return[];let K=[];for(let{jobId:V,step:M}of X(z)){if(!(typeof M.uses==="string"?M.uses:"").startsWith("actions/checkout@"))continue;let Q=typeof M.with?.ref==="string"?M.with.ref:null;if(!Q)continue;if(Q.includes("pull_request")||Q.includes("head.sha")||Q.includes("head.ref")||Q.includes("github.head_ref"))K.push({ruleId:this.id,severity:this.defaultSeverity,message:`Job \`${V}\` checks out PR-author code under \`pull_request_target\`.`,detail:"This grants attacker-controlled code access to repository secrets and write tokens. Move the build to `pull_request` or run untrusted code in a sandboxed second workflow without secrets.",file:z.file,line:B(z.raw,Q),fix:"Either switch the trigger to `pull_request`, or split into two workflows: one privileged (no checkout of head) and one unprivileged (checkout of head, no secrets)."})}return K}};function x(z,K){if(typeof z==="string")return z===K;if(Array.isArray(z))return z.includes(K);if(z&&typeof z==="object")return K in z;return!1}var q={id:"excessive-permissions",defaultSeverity:"warning",description:"Workflows and jobs should declare a least-privilege `permissions:` block.",check(z){let K=[],V=z.data.permissions;if(V===void 0)K.push({ruleId:this.id,severity:this.defaultSeverity,message:"Workflow does not declare top-level `permissions:`.",detail:"Without an explicit `permissions:` block, jobs inherit the repository default \u2014 historically `write-all`. Add a least-privilege block at the workflow root.",file:z.file,line:1,fix:"Add `permissions:\\n contents: read` at the top of the workflow, then narrow per-job as needed."});else if(V==="write-all")K.push({ruleId:this.id,severity:"error",message:"Workflow grants `permissions: write-all`.",file:z.file,line:B(z.raw,"write-all"),fix:"Replace with explicit per-scope grants (e.g. `contents: read`, `pull-requests: write`)."});else if(V!=="read-all"&&typeof V==="object")K.push(...P(this.id,z.file,z.raw,V,"workflow"));for(let{jobId:M,job:Y}of $(z)){let Q=Y.permissions;if(Q===void 0)continue;if(Q==="write-all")K.push({ruleId:this.id,severity:"error",message:`Job \`${M}\` grants \`permissions: write-all\`.`,file:z.file,line:B(z.raw,"write-all"),fix:"Replace with explicit per-scope grants."});else if(Q!=="read-all"&&typeof Q==="object")K.push(...P(this.id,z.file,z.raw,Q,`job \`${M}\``))}return K}};function P(z,K,V,M,Y){let Q=[];if(typeof M!=="object"||M===null)return Q;for(let[Z,N]of Object.entries(M))if(N==="write"&&(Z==="actions"||Z==="id-token"))Q.push({ruleId:z,severity:"warning",message:`${Y} grants \`${Z}: write\` \u2014 verify this is required.`,detail:Z==="id-token"?"`id-token: write` is needed for OIDC federation but should never be combined with running untrusted code.":"`actions: write` allows the workflow to dispatch other workflows, increasing blast radius if compromised.",file:K,line:B(V,`${Z}: write`)});return Q}var D={id:"missing-timeout",defaultSeverity:"warning",description:"Jobs should declare an explicit `timeout-minutes` to bound runaway execution.",check(z){let K=[];for(let{jobId:V,job:M}of $(z)){let Y=M["timeout-minutes"];if(typeof Y==="number"&&Y>0)continue;K.push({ruleId:this.id,severity:this.defaultSeverity,message:`Job \`${V}\` has no \`timeout-minutes\`.`,file:z.file,line:B(z.raw,`${V}:`),fix:"Add `timeout-minutes: <n>` (15\u201360 is a reasonable default for most CI jobs)."})}return K}};var G={id:"self-hosted-exposure",defaultSeverity:"warning",description:"Self-hosted runners should be scoped with additional labels, not used bare.",check(z){let K=[];for(let{jobId:V,job:M}of $(z)){let Y=M["runs-on"];if(!Y)continue;if(typeof Y==="string"){if(Y==="self-hosted")K.push({ruleId:this.id,severity:this.defaultSeverity,message:`Job \`${V}\` uses bare \`runs-on: self-hosted\`.`,file:z.file,line:B(z.raw,"runs-on: self-hosted"),fix:"Add at least one scoping label, e.g. `runs-on: [self-hosted, my-project]`, and disable persistence on the runner."});continue}if(Array.isArray(Y)){let Q=Y.filter((Z)=>typeof Z==="string");if(Q.includes("self-hosted")&&Q.length===1)K.push({ruleId:this.id,severity:this.defaultSeverity,message:`Job \`${V}\` uses \`runs-on: [self-hosted]\` with no additional labels.`,file:z.file,line:B(z.raw,"self-hosted"),fix:"Add at least one scoping label (project name, environment) so the pool is explicit."})}}return K}};var v=/^[0-9a-f]{40}$/i,E={id:"unpinned-action",defaultSeverity:"warning",description:"Third-party actions should be pinned to a full commit SHA, not a tag or branch.",check(z){let K=[];for(let{step:V}of X(z)){let M=typeof V.uses==="string"?V.uses:null;if(!M)continue;if(M.startsWith("./")||M.startsWith("docker://"))continue;let Y=M.lastIndexOf("@");if(Y<0){K.push({ruleId:this.id,severity:this.defaultSeverity,message:`Action \`${M}\` is missing a version reference.`,file:z.file,line:B(z.raw,M),fix:`Pin to a commit SHA: \`${M}@<full-sha> # vX.Y.Z\``});continue}let Q=M.slice(0,M.indexOf("/")),Z=M.slice(Y+1);if(Q==="actions"||Q==="github")continue;if(v.test(Z))continue;K.push({ruleId:this.id,severity:this.defaultSeverity,message:`Action \`${M}\` is pinned to a mutable ref (\`${Z}\`).`,file:z.file,line:B(z.raw,M),fix:`Replace with a SHA-pinned reference: \`${M.slice(0,Y)}@<full-sha> # ${Z}\``})}return K}};var H=[E,q,J,F,D,G];async function Tz(z,K={}){let V=await W(z);return y(V,K)}function y(z,K={}){let V=(K.rules??H).filter((Q)=>{return!K.ignore?.includes(Q.id)}),M=[];for(let Q of z)for(let Z of V){let N=Z.check(Q);for(let C of N)M.push(C)}let Y=M.some((Q)=>Q.severity==="error");return{workflows:z,findings:M,failed:Y}}
|
|
3
|
-
export{Tz as
|
|
3
|
+
export{Tz as ge,y as he};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Da as a}from"./chunk-cm6devhe.js";import"./chunk-rygtb1x3.js";import"./chunk-08daxhzx.js";import"./chunk-d4gk9awk.js";import"./chunk-gweqk008.js";import"./chunk-bnp0r4eh.js";import"./chunk-0f1xye20.js";import"./chunk-9sdgy9nm.js";import"./chunk-5jvde2as.js";import"./chunk-ctdfppxk.js";import"./chunk-wjfw6rx8.js";import"./chunk-w55x2g9n.js";import"./chunk-1xe0960b.js";import"./chunk-gpjde0j6.js";import"./chunk-j46f90n8.js";import"./chunk-enq0gm64.js";import"./chunk-c6ptrc0v.js";import"./chunk-1pecmenc.js";import"./chunk-sxfk3naz.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-2z2gh050.js";import"./chunk-knpdntnh.js";import"./chunk-54er1whp.js";import"./chunk-ktn47bq8.js";import"./chunk-2z9pkk1y.js";import"./chunk-vpw7adwd.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.js";export{a as Scheduler};
|
|
@@ -59,4 +59,4 @@ You cannot modify anything.
|
|
|
59
59
|
|
|
60
60
|
Name the files that would change and why, the order of the work, the risks,
|
|
61
61
|
and how the result would be verified.`},z={review:B,implement:F,"fix-ci":H,plan:I};function J(j){let q=z[j];if(!q)throw Error(`Unknown agent mode: ${j}. Available: ${Object.keys(z).join(", ")}`);return q}
|
|
62
|
-
export{B as
|
|
62
|
+
export{B as zf,F as Af,H as Bf,I as Cf,z as Df,J as Ef};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Jh as O}from"./chunk-b9szrnxw.js";import{Ph as q}from"./chunk-x1w6q9tk.js";import{el as p}from"./chunk-kbvj6qxc.js";var T=/(?:^|[-_.])(?:rc|alpha|beta|pre|dev|nightly|canary|snapshot|edge|next)\d*(?:$|[-_.])/i;function B(j){let z=/^v?(\d+(?:\.\d+)*)(.*)$/.exec(j.trim());if(!z)return null;let[,G,Q]=z,J=T.test(Q),Y=Q.replace(T,(Z)=>{return Z.endsWith("-")||Z.endsWith("_")||Z.endsWith(".")?"-":""}).replace(/^[-_.]/,"").toLowerCase();return{raw:j,version:G.split(".").map(Number),suffix:Y,prerelease:J}}function x(j,z){for(let G=0;G<Math.max(j.length,z.length);G++){let Q=(j[G]??0)-(z[G]??0);if(Q!==0)return Q}return j.length-z.length}function k(j,z){let G=(Q)=>/^[a-z]+/.exec(Q)?.[0]??Q;return G(j)===G(z)}function b(j,z,G={}){let Q=B(j);if(!Q)return null;let J=z.map(B).filter((Y)=>Y!==null).filter((Y)=>G.includePrerelease?!0:!Y.prerelease).filter((Y)=>k(Y.suffix,Q.suffix)).filter((Y)=>Y.version.length===Q.version.length).filter((Y)=>x(Y.version,Q.version)>0);if(J.length===0)return null;return J.sort((Y,Z)=>x(Z.version,Y.version)),J[0].raw}function l(j,z){let G=B(j),Q=B(z);if(!G||!Q)return"patch";if((Q.version[0]??0)!==(G.version[0]??0))return"major";if((Q.version[1]??0)!==(G.version[1]??0))return"minor";return"patch"}import P from"process";var v="registry-1.docker.io";function U(j){let z=j.trim(),G,Q=z.indexOf("@");if(Q!==-1)G=z.slice(Q+1),z=z.slice(0,Q);let J=z.indexOf("/"),Y=J===-1?"":z.slice(0,J),Z=Y==="localhost"||Y.includes(".")||Y.includes(":"),X=Z?Y:"docker.io",$=Z?z.slice(J+1):z,K="latest",S=$.lastIndexOf("/"),W=$.indexOf(":",S+1);if(W!==-1)K=$.slice(W+1),$=$.slice(0,W);let M=X==="docker.io"&&!$.includes("/")?`library/${$}`:$;return{registry:X,repository:M,tag:K,...G?{digest:G}:{}}}function i(j){let z=j.registry==="docker.io"?j.repository.replace(/^library\//,""):`${j.registry}/${j.repository}`;return j.digest?`${z}:${j.tag}@${j.digest}`:`${z}:${j.tag}`}function C(j){return j==="docker.io"?v:j}function y(j,z,G=P.env){let Q=z?.[j];if(Q?.tokenEnv){let J=G[Q.tokenEnv]?.trim();if(J)return{token:J}}if(Q?.username&&Q.passwordEnv){let J=G[Q.passwordEnv]?.trim();if(J)return{username:Q.username,password:J}}if(j==="ghcr.io"){let J=G.GITHUB_TOKEN?.trim()||G.BUDDY_TOKEN?.trim();if(J)return{username:"buddy",password:J}}if(j==="docker.io"){let J=G.DOCKERHUB_TOKEN?.trim()||G.DOCKER_TOKEN?.trim();if(J)return{username:G.DOCKERHUB_USERNAME?.trim()||"buddy",password:J}}return null}function R(j){if(!j?.toLowerCase().startsWith("bearer "))return null;let z={};for(let G of j.slice(7).matchAll(/(\w+)="([^"]*)"/g))z[G[1]]=G[2];return z.realm?{realm:z.realm,...z.service?{service:z.service}:{},...z.scope?{scope:z.scope}:{}}:null}function u(j,z){let G=new URL(j.realm);if(j.service)G.searchParams.set("service",j.service);return G.searchParams.set("scope",j.scope??`repository:${z}:pull`),G.toString()}class H{options;logger;tokens=new Map;constructor(j={}){this.options=j;this.logger=j.logger??q()}async listTags(j){let z=C(j.registry),G=this.options.maxPages??10,Q=[],J=`https://${z}/v2/${j.repository}/tags/list?n=100`;for(let Y=0;Y<G&&J;Y++){let Z=await this.authorizedFetch(J,j);if(!Z?.ok){if(Y===0)this.logger.debug(`Could not list tags for ${j.repository} on ${j.registry}: ${Z?.status??"no response"}`);break}let X=await Z.json().catch(()=>null);if(Array.isArray(X?.tags))Q.push(...X.tags);J=h(Z.headers.get("link"),z)}return Q}async resolveDigest(j){let G=`https://${C(j.registry)}/v2/${j.repository}/manifests/${j.tag}`,Q=await this.authorizedFetch(G,j,{method:"HEAD",headers:{Accept:["application/vnd.oci.image.index.v1+json","application/vnd.oci.image.manifest.v1+json","application/vnd.docker.distribution.manifest.list.v2+json","application/vnd.docker.distribution.manifest.v2+json"].join(", ")}});return Q?.ok?Q.headers.get("docker-content-digest"):null}async authorizedFetch(j,z,G={}){let Q={"User-Agent":"buddy",...G.headers},J=this.tokens.get(I(z));if(J)Q.Authorization=`Bearer ${J}`;let Y=()=>O(j,{...G,headers:Q}).catch(()=>null),Z=await Y();if(Z?.status!==401||J!==void 0)return Z;let X=R(Z.headers.get("www-authenticate"));if(!X)return Z;let $=await this.fetchToken(X,z);if(!$)return Z;return this.tokens.set(I(z),$),Q.Authorization=`Bearer ${$}`,Z=await Y(),Z}async fetchToken(j,z){let G=y(z.registry,this.options.registries,this.options.env);if(G&&"token"in G)return G.token;let Q={"User-Agent":"buddy"};if(G){let Z=Buffer.from(`${G.username}:${G.password}`).toString("base64");Q.Authorization=`Basic ${Z}`}let J=await O(u(j,z.repository),{headers:Q}).catch(()=>null);if(!J?.ok)return this.logger.debug(`Token exchange failed for ${z.registry}/${z.repository}: ${J?.status??"no response"}`),null;let Y=await J.json().catch(()=>null);return Y?.token??Y?.access_token??null}}function I(j){return`${j.registry}/${j.repository}`}function h(j,z){if(!j)return null;let G=/<([^>]+)>\s*;\s*rel="?next"?/i.exec(j);if(!G)return null;let Q=G[1];return Q.startsWith("http")?Q:`https://${z}${Q}`}var m=[".md",".txt",".log",".bak",".orig",".example",".sample",".tmpl",".template"];function F(j){let z=(j.split("/").pop()||"").toLowerCase();if(!z)return!1;if(m.some((G)=>z.endsWith(G)))return!1;if(z==="containerfile"||z.startsWith("containerfile."))return!0;if(z==="dockerfile"||z.startsWith("dockerfile."))return!0;return z.endsWith(".dockerfile")||z.endsWith(".containerfile")}async function jj(j,z){try{if(!F(j))return null;let G=[],Q=z.split(`
|
|
3
3
|
`);for(let J=0;J<Q.length;J++){let Y=Q[J].trim();if(!Y||Y.startsWith("#"))continue;let Z=Y.match(/^FROM\s+(\S+)(?:\s+as\s+\w+)?$/i);if(Z){let X=Z[1];if(X==="scratch"||X.startsWith("$"))continue;let $=c(X);if($)G.push({name:$.name,currentVersion:$.version,type:"docker-image",file:j})}}return{path:j,type:"Dockerfile",content:z,dependencies:G}}catch(G){return q().warn(`Failed to parse Dockerfile ${j}:`,G),null}}function c(j){try{let z,G,Q=j.indexOf("@"),J=Q===-1?void 0:j.slice(Q+1);if(Q!==-1)j=j.slice(0,Q);if(J&&!j.includes(":"))return null;if(j.includes(":")){let Y=j.lastIndexOf(":"),Z=j.substring(0,Y),X=j.substring(Y+1);if(/^\d+\//.test(X))z=j,G="latest";else z=Z,G=X}else z=j,G="latest";if(G.includes("$")||G.startsWith("sha256:"))return null;return{name:z,version:G,...J?{digest:J}:{}}}catch(z){return q().warn(`Failed to parse image reference ${j}:`,z),null}}async function zj(j,z,G={}){try{let Q=j.replace(/\s*\(.*\)$/,""),J=U(z?`${Q}:${z}`:Q),Z=await new H({...G.registries?{registries:G.registries}:{},logger:q()}).listTags(J);if(Z.length===0)return null;return b(J.tag,Z,{includePrerelease:G.includePrerelease??!1})}catch(Q){return q().warn(`Failed to fetch latest version for Docker image ${j}:`,Q),null}}async function d(j,z,G){let Q=U(`${j.replace(/\s*\(.*\)$/,"")}:${z}`);return new H({...G?{registries:G}:{},logger:q()}).resolveDigest(Q)}async function f(j,z,G,Q){try{if(!F(j))return q().info(`\u26A0\uFE0F updateDockerfile: ${j} is not a Dockerfile, returning original content`),z;let J=z;for(let Y of G){if(Y.dependencyType!=="docker-image")continue;let Z=Y.name.replace(/\s*\(.*\)$/,""),X=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),$=new RegExp(`(FROM\\s+${X})(:)([^\\s@]+)(@sha256:[a-f0-9]+)?([ \\t].*)?$`,"gim"),K=(W)=>{let M=["latest","main","master","develop","dev","stable"],w=W.toLowerCase().trim();return M.includes(w)},S=J.matchAll($);for(let W of S){let M=W[0],w=W[1],L=W[2],_=W[3],V=W[4]||"",D=W[5]||"";if(K(_)){q().info(`\u26A0\uFE0F Skipping update for ${Z} - version "${_}" should be respected`);continue}let A=V;if(V){let E=await d(Z,Y.newVersion,Q);if(!E){q().warn(`\u26A0\uFE0F Leaving ${Z} pinned at ${_}: could not resolve the digest for ${Y.newVersion}`);continue}A=`@${E}`}let N=`${w}${L}${Y.newVersion}${A}${D}`;J=J.replace(M,N),q().info(`\uD83D\uDCDD Updated ${Z}: ${_} \u2192 ${Y.newVersion}${A?" (digest re-resolved)":""}`)}}return J}catch(J){return q().warn(`Failed to update Dockerfile ${j}:`,J),z}}async function Gj(j,z){let G=[],Q=new Map;for(let J of j)if(J.dependencyType==="docker-image"&&F(J.file)){if(!Q.has(J.file))Q.set(J.file,[]);Q.get(J.file).push(J)}for(let[J,Y]of Q)try{let Z=await import("fs");if(Z.existsSync(J)){let X=Z.readFileSync(J,"utf-8"),$=await f(J,X,Y,z);if($!==X)G.push({path:J,content:$,type:"update"}),q().info(`\u2705 Generated update for ${J} with ${Y.length} image changes`);else q().info(`\u2139\uFE0F No changes needed for ${J} - versions already up to date`)}else q().warn(`\u26A0\uFE0F Dockerfile ${J} does not exist`)}catch(Z){q().warn(`Failed to generate updates for Dockerfile ${J}:`,Z)}return G}
|
|
4
|
-
export{B as
|
|
4
|
+
export{B as Fe,x as Ge,k as He,b as Ie,l as Je,U as Ke,i as Le,C as Me,y as Ne,R as Oe,H as Pe,F as Qe,jj as Re,zj as Se,d as Te,f as Ue,Gj as Ve};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Nc as a,Oc as b,Pc as c,Qc as d,Rc as e,Sc as f,Tc as g}from"./chunk-s1cgwkkr.js";import"./chunk-2z2gh050.js";import"./chunk-knpdntnh.js";import"./chunk-54er1whp.js";import"./chunk-ktn47bq8.js";import"./chunk-2z9pkk1y.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.js";export{b as regenerateLockFile,d as nestedLockProjects,f as missingLockFiles,e as lockFileFor,g as hasLockFile,a as getAllLockFilePaths,c as detectRequiredPackageManagers};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ud as R}from"./chunk-7b4jsg36.js";import{re as F,se as A}from"./chunk-ctdfppxk.js";import{Bf as S}from"./chunk-1pecmenc.js";import{Rf as L}from"./chunk-sxfk3naz.js";import{Mh as K,Ph as O}from"./chunk-x1w6q9tk.js";import{el as P}from"./chunk-kbvj6qxc.js";var b=[{kind:"lockfile-drift",mechanical:!0,patterns:[/lockfile had changes, but lockfile is frozen/i,/your lockfile does not satisfy your workspace/i,/the lockfile (?:is|was) out of date/i,/npm ci can only install packages when your package\.json and package-lock\.json .* are in sync/i,/composer\.lock is not up to date/i]},{kind:"flake",mechanical:!0,patterns:[/\bECONNRESET\b|\bETIMEDOUT\b|\bENOTFOUND\b|\bEAI_AGAIN\b/,/socket hang up/i,/502 Bad Gateway|503 Service Unavailable|504 Gateway Time-?out/i,/rate limit exceeded/i,/the runner has received a shutdown signal/i]},{kind:"install",mechanical:!1,patterns:[/could not resolve (?:dependency|host)/i,/no matching version found for/i,/unable to resolve dependency tree/i,/peer dep(?:endency)? .* conflict/i]},{kind:"type-error",mechanical:!1,patterns:[/error TS\d{4}:/,/\berror\[E\d+\]:/,/Type '.*' is not assignable to type/]},{kind:"test-failure",mechanical:!1,patterns:[/\d+ (?:tests? )?fail(?:ed|ing)\b/i,/\(fail\)/,/AssertionError|expect\(received\)/,/\u25CF .* \u203A /]},{kind:"lint",mechanical:!1,patterns:[/\b\d+ problems? \(\d+ errors?/i,/eslint|pickier|biome|oxlint/i]}];function N(x){if(!x.trim())return{kind:"unknown",mechanical:!1,evidence:[]};let H=x.split(`
|
|
3
3
|
`);for(let z of b){let J=[];for(let V of H)if(z.patterns.some((Q)=>Q.test(V))){if(J.push(V.trim()),J.length>=5)break}if(J.length>0)return{kind:z.kind,mechanical:z.mechanical,evidence:J}}return{kind:"unknown",mechanical:!1,evidence:T(H)}}function T(x,H=40){let z=x.filter((J)=>/\b(?:error|failed|failure|exception|panic|fatal)\b/i.test(J)&&!/^\s*(?:at\s|\s*\.\.\.)/.test(J));return(z.length>0?z:x.slice(-H)).slice(-H).map((J)=>J.trim()).filter(Boolean)}function G(x){switch(x.kind){case"lockfile-drift":return"The lock file is out of step with its manifest.";case"flake":return"A network or runner problem, unrelated to the change.";case"install":return"Dependencies could not be resolved.";case"type-error":return"The change does not type-check.";case"test-failure":return"One or more tests failed.";case"lint":return"Lint or formatting checks failed.";default:return"The failure could not be classified automatically."}}var w=3;async function M(x,H,z,J){let V=J??O();try{let Q=await x.listWorkflowRuns(H,{status:"completed",limit:20});for(let Y of _(Q).slice(0,w)){let Z=await x.getWorkflowRunLogs(Y.id);if(!Z)continue;if(N(Z).kind===z)return V.info(`\uD83E\uDDED ${H} already fails the same way (run ${Y.id}) \u2014 not this pull request's to fix`),!0}return!1}catch(Q){return V.debug(`Could not check ${H} for a pre-existing failure: ${K(Q)}`),!1}}function _(x){let H=new Map;for(let z of x)if(!H.has(z.name))H.set(z.name,z);return[...H.values()].filter((z)=>z.conclusion==="failure")}function h(x,H){if(!x)return"Tried to regenerate the lock file, but the install did not succeed.";if(!H)return"Regenerated the lock file, but could not push it to the branch. The change is in the workspace only, so the run will still be red until someone commits it.";return"Regenerated the lock file and pushed the result. No model was needed."}function f(x){let H="Repairs run on the pull request's branch, and answering a comment runs on the default branch, so anything I changed here would land on the wrong tree. ";if(x.kind==="lockfile-drift")return`Regenerating the lock file would fix this, and no model would be needed. ${H}The \`fix-ci\` job will do it on the next failing run, or you can run \`buddy fix-ci --run-id <id> --pr <number>\` yourself.`;return`${H}The \`fix-ci\` job runs on the failing run itself and can repair this; this reply is the diagnosis it would start from.`}async function I(x){let H=x.logger??O(),z=N(x.log),J=x.maxAttempts??3;if(H.info(`\uD83E\uDE7A CI failure classified as ${z.kind}`),x.failsOnBase??(x.checkBase?await x.checkBase(z.kind):!1))return{failure:z,action:"skipped",fixed:!1,report:$(z,"This failure also occurs on the base branch, so it is not caused by this change. Fixing it here would only mask it.")};if((x.priorAttempts??0)>=J)return{failure:z,action:"skipped",fixed:!1,report:$(z,`Already attempted ${x.priorAttempts} time(s); stopping rather than looping.`)};if(x.analysisOnly&&z.kind!=="flake")return{failure:z,action:"reported",fixed:!1,report:$(z,f(z))};if(z.kind==="lockfile-drift"&&x.regenerateLockfile){if(x.dryRun)return{failure:z,action:"mechanical-fix",fixed:!1,report:$(z,"Regenerating the lock file would fix this. No model would be needed. Nothing was changed, because this was a dry run.")};H.info("\uD83D\uDD27 Regenerating the lock file");let{regenerated:Y,pushed:Z}=await x.regenerateLockfile();return{failure:z,action:"mechanical-fix",fixed:Z,report:$(z,h(Y,Z))}}if(z.kind==="flake"){if(x.dryRun)return{failure:z,action:"retry",fixed:!1,report:$(z,"This looks transient, and re-running the failed jobs would likely clear it. Nothing was changed, because this was a dry run.")};if(!x.rerun)return{failure:z,action:"retry",fixed:!1,report:$(z,"This looks transient. Re-running the failed job is likely to clear it.")};H.info("\uD83D\uDD01 Re-running the failed jobs");let Y=await x.rerun();return{failure:z,action:"retry",fixed:!1,report:$(z,Y?"This looks transient, so I re-ran the failed jobs. No model was needed.":"This looks transient, but I could not re-run the failed jobs \u2014 `actions: write` is the usual reason. "+"Re-running them from the Actions tab is likely to clear it.")}}if(!x.ai)return{failure:z,action:"reported",fixed:!1,report:$(z,"No AI provider is configured, so this needs a human. See https://buddy.sh/ai/providers to enable automatic repair.")};let Q=await L(x.ai,{mode:S,task:["A CI job on this branch is failing. Diagnose the root cause and fix it if the fix is clear.","",`Classification: ${z.kind} \u2014 ${G(z)}`,"","Relevant log lines:",z.evidence.join(`
|
|
4
4
|
`),"","Verify your fix by running the project's tests or build before reporting it done.","If the fix is not clear, explain what you found rather than guessing."].join(`
|
|
5
5
|
`),context:{workspace:x.workspace,baseBranch:x.baseBranch,...x.branch?{branch:x.branch}:{}},logger:H});return{failure:z,action:"agent-fix",fixed:Q.stopReason==="completed",report:$(z,Q.output||"The repair run ended without a conclusion.")}}function $(x,H){let z=`## \uD83E\uDE7A CI failure analysis
|
|
@@ -20,8 +20,8 @@ ${x.evidence.slice(0,20).join(`
|
|
|
20
20
|
${JSON.stringify(J)}
|
|
21
21
|
-->`;return`${(x??"").replace(B,"").trimEnd()}
|
|
22
22
|
|
|
23
|
-
${V}`}async function m(x,H,z){if(!F(x,"ciRuns","listWorkflowRuns"))return null;try{let J=await x.getPullRequestHeadSha(H.number),V=await x.listWorkflowRuns(H.head,{status:"completed",limit:30}),Q=J?V.filter((Y)=>Y.headSha===J):V;return _(Q)[0]?.id??null}catch(J){return z.debug(`Could not resolve the failing run for #${H.number}: ${K(J)}`),null}}async function c(x){let H=x.logger??O(),{config:z,provider:J}=x,V=x.workspace??process.cwd();A(J,"ciLogs","getWorkflowRunLogs","reading CI logs");let Q;if(x.prNumber){if(Q=(await J.getPullRequests("open")).find((W)=>W.number===x.prNumber),!Q)return`Could not find open pull request #${x.prNumber}.`}let Y=x.runId??(Q?await m(J,Q,H):null);if(!Y)return Q?"Nothing is failing at the head of this pull request, so there is nothing to diagnose.":"No run to diagnose. Pass --run-id, or --pr so I can find the failing run myself.";let Z=await J.getWorkflowRunLogs(Y);if(!Z)return H.warn(`\u26A0\uFE0F Could not read the logs for run ${Y}; nothing to diagnose`),`Could not read the logs for run ${Y}. They may have expired.`;let U=E(Q?.body)?.attempts??0,j=z.repository?.baseBranch??"main",D=F(J,"ciRuns","listWorkflowRuns"),y=F(J,"ciRuns","rerunWorkflowRun"),{createAiClient:v}=await import("./chunk-
|
|
23
|
+
${V}`}async function m(x,H,z){if(!F(x,"ciRuns","listWorkflowRuns"))return null;try{let J=await x.getPullRequestHeadSha(H.number),V=await x.listWorkflowRuns(H.head,{status:"completed",limit:30}),Q=J?V.filter((Y)=>Y.headSha===J):V;return _(Q)[0]?.id??null}catch(J){return z.debug(`Could not resolve the failing run for #${H.number}: ${K(J)}`),null}}async function c(x){let H=x.logger??O(),{config:z,provider:J}=x,V=x.workspace??process.cwd();A(J,"ciLogs","getWorkflowRunLogs","reading CI logs");let Q;if(x.prNumber){if(Q=(await J.getPullRequests("open")).find((W)=>W.number===x.prNumber),!Q)return`Could not find open pull request #${x.prNumber}.`}let Y=x.runId??(Q?await m(J,Q,H):null);if(!Y)return Q?"Nothing is failing at the head of this pull request, so there is nothing to diagnose.":"No run to diagnose. Pass --run-id, or --pr so I can find the failing run myself.";let Z=await J.getWorkflowRunLogs(Y);if(!Z)return H.warn(`\u26A0\uFE0F Could not read the logs for run ${Y}; nothing to diagnose`),`Could not read the logs for run ${Y}. They may have expired.`;let U=E(Q?.body)?.attempts??0,j=z.repository?.baseBranch??"main",D=F(J,"ciRuns","listWorkflowRuns"),y=F(J,"ciRuns","rerunWorkflowRun"),{createAiClient:v}=await import("./chunk-vtr2vbk0.js"),C=await I({log:Z,priorAttempts:U,workspace:V,baseBranch:j,ai:x.analysisOnly?null:v(z,H),logger:H,dryRun:Boolean(x.dryRun),analysisOnly:Boolean(x.analysisOnly),...D?{checkBase:(X)=>M({listWorkflowRuns:(W,k)=>J.listWorkflowRuns(W,k),getWorkflowRunLogs:(W)=>J.getWorkflowRunLogs(W)},j,X,H)}:{},...y?{rerun:()=>J.rerunWorkflowRun(Y)}:{},...x.analysisOnly?{}:{regenerateLockfile:()=>g(V,H)}});if(H.info(`
|
|
24
24
|
${C.report}
|
|
25
|
-
`),x.prNumber&&!x.dryRun){if(await J.createComment(x.prNumber,C.report),C.action!=="skipped"&&Q)try{await J.updatePullRequest(x.prNumber,{body:q(Q.body,U+1)})}catch(X){H.warn(`Could not record the fix attempt on PR #${x.prNumber}: ${K(X)}`)}}return await R(z.notifications,"fixci.completed",{...x.prNumber?{number:x.prNumber}:{},action:C.action,fixed:C.fixed}),`${C.action}${C.fixed?" (fixed)":""}`}async function g(x,H){let{regenerateLockFile:z,detectRequiredPackageManagers:J,getAllLockFilePaths:V,hasLockFile:Q}=await import("./chunk-
|
|
25
|
+
`),x.prNumber&&!x.dryRun){if(await J.createComment(x.prNumber,C.report),C.action!=="skipped"&&Q)try{await J.updatePullRequest(x.prNumber,{body:q(Q.body,U+1)})}catch(X){H.warn(`Could not record the fix attempt on PR #${x.prNumber}: ${K(X)}`)}}return await R(z.notifications,"fixci.completed",{...x.prNumber?{number:x.prNumber}:{},action:C.action,fixed:C.fixed}),`${C.action}${C.fixed?" (fixed)":""}`}async function g(x,H){let{regenerateLockFile:z,detectRequiredPackageManagers:J,getAllLockFilePaths:V,hasLockFile:Q}=await import("./chunk-225s199d.js"),{commitAndPush:Y}=await import("./chunk-ry5zh9cx.js"),Z=J(["package.json","composer.json"],x).filter((j)=>Q(j,x)),U=!1;for(let j of Z){let D=await z(j,x);if(D.success)U=!0;else H.warn(`\u26A0\uFE0F ${D.message}`)}if(!U)return{regenerated:!1,pushed:!1};try{return{regenerated:!0,pushed:await Y(V(),`fix(deps): regenerate the lock file
|
|
26
26
|
|
|
27
27
|
The lock file had drifted from the manifest, which failed CI.`,x)}}catch(j){return H.warn(`\u26A0\uFE0F Could not push the regenerated lock file: ${K(j)}`),{regenerated:!0,pushed:!1}}}export{N as Ea,T as Fa,G as Ga,M as Ha,_ as Ia,I as Ja,c as Ka};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var{Glob:F}=globalThis.Bun;function K(k){if(!k||k.length===0)return{matches:()=>!0};let q=k.map((j)=>{let B=j.startsWith("!"),C=B?j.slice(1):j;return{negated:B,glob:new F(C),pattern:C}}),D=q.some((j)=>!j.negated);return{matches(j){let B=j.replace(/^\.\//,""),C=!D;for(let E of q){if(!H(E.glob,B))continue;C=!E.negated}return C}}}function L(k,q){if(!q?.length)return[];let D=k.replace(/^\.\//,"");return q.filter((j)=>H(new F(j.path),D)).sort((j,B)=>j.path.length-B.path.length).map((j)=>j.instructions)}function H(k,q){try{return k.match(q)}catch{return!1}}
|
|
3
|
-
export{K as
|
|
3
|
+
export{K as Sf,L as Tf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Dg as mc,Eg as nc,Fg as oc,Gg as pc,Hg as qc,Ig as rc,Jg as sc,Kg as tc,Lg as uc,Mg as vc,Ng as wc,Og as xc,Pg as yc,Qg as zc,Rg as Ac,Sg as Bc,Tg as Cc,Ug as Dc,Vg as Ec,Wg as Fc}from"./chunk-ktn47bq8.js";import{$h as k,$i as ja,$j as jb,$k as jc,Ai as K,Aj as Ka,Ak as Kb,Bi as L,Bj as La,Bk as Lb,Ci as M,Cj as Ma,Ck as Mb,Di as N,Dj as Na,Dk as Nb,Ei as O,Ej as Oa,Ek as Ob,Fi as P,Fj as Pa,Fk as Pb,Gi as Q,Gj as Qa,Gk as Qb,Hi as R,Hj as Ra,Hk as Rb,Ii as S,Ij as Sa,Ik as Sb,Ji as T,Jj as Ta,Jk as Tb,Ki as U,Kj as Ua,Kk as Ub,Li as V,Lj as Va,Lk as Vb,Mi as W,Mj as Wa,Mk as Wb,Ni as X,Nj as Xa,Nk as Xb,Oi as Y,Oj as Ya,Ok as Yb,Pi as Z,Pj as Za,Pk as Zb,Qh as a,Qi as _,Qj as _a,Qk as _b,Rh as b,Ri as $,Rj as $a,Rk as $b,Sh as c,Si as aa,Sj as ab,Sk as ac,Ti as ba,Tj as bb,Tk as bc,Uh as d,Ui as ca,Uj as cb,Uk as cc,Vh as e,Vi as da,Vj as db,Vk as dc,Wh as f,Wi as ea,Wj as eb,Wk as ec,Xh as g,Xi as fa,Xj as fb,Xk as fc,Yh as h,Yi as ga,Yj as gb,Yk as gc,Zh as i,Zi as ha,Zj as hb,Zk as hc,_h as j,_i as ia,_j as ib,_k as ic,ai as l,aj as ka,ak as kb,al as kc,bi as m,bj as la,bk as lb,bl as lc,ci as n,cj as ma,ck as mb,di as o,dj as na,dk as nb,ei as p,ej as oa,ek as ob,fi as q,fj as pa,fk as pb,gi as r,gj as qa,gk as qb,hi as s,hj as ra,hk as rb,ii as t,ij as sa,ik as sb,ji as u,jj as ta,jk as tb,ki as v,kj as ua,kk as ub,li as w,lj as va,lk as vb,mi as x,mj as wa,mk as wb,ni as y,nj as xa,nk as xb,oi as z,oj as ya,ok as yb,pi as A,pj as za,pk as zb,qi as B,qj as Aa,qk as Ab,ri as C,rj as Ba,rk as Bb,si as D,sj as Ca,sk as Cb,tj as Da,tk as Db,ui as E,uj as Ea,uk as Eb,vi as F,vj as Fa,vk as Fb,wi as G,wj as Ga,wk as Gb,xi as H,xj as Ha,xk as Hb,yi as I,yj as Ia,yk as Ib,zi as J,zj as Ja,zk as Jb}from"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.js";export{Ta as ziglangOfficialDownload,ab as zigRegistryMirror,bb as zigPurgedDevBuildHint,eb as zigOriginVersions,Wb as writeOciLayout,Xb as writeDockerArchive,Cc as withTempDirSync,Bc as withTempDir,yc as withRedis,uc as withPostgres,qc as withMysql,ic as waitForAppStoreBuilds,ac as verifyBlob,n as validatePackageSpec,Aa as validatePackage,sa as v,xc as useRedis,tc as usePostgres,pc as useMysql,zb as updatePackageVersionMap,ca as updateApp,sb as uninstallShellInit,ub as toTypeName,tb as toSafeVarName,vb as toPackageVarName,Fc as testingRuntime,mb as supportedPackages,wc as stopRedis,sc as stopPostgres,oc as stopMysql,vc as startRedis,rc as startPostgres,S as startPeriodicCleanup,nc as startMysql,Ua as sqliteOfficialDownloadUrl,va as showPackageInfo,x as shouldProceedWithGitHubRequest,R as setupCleanupHandlers,Ub as serializeConfig,wa as searchPackagesCommand,j as searchPackages,V as scanPantryPackages,$ as scanInstalledApps,N as saveToCacheAndOutput,w as saveRateLimitInfo,K as savePackageAsTypeScript,z as saveGitHubPackageCache,db as satisfiesInstallerConstraint,ib as retryNetworkOperation,q as resolveVersionFromMetadata,Ka as resolveVersionConstraint,h as resolveVersion,Ma as resolveTransitiveDependencies,ka as resolvePackageName,G as resolvePackageDomain,Cb as resolvePackageDependencies,Xa as resolveLatestVersion,gb as resolveInstallerConstraintFromCandidates,Oa as resolveDependencyFile,Bb as resolveDependenciesFromYaml,Ab as resolveDependencies,Mb as resolveBuildStages,qb as renderShellSnippet,dc as renderDockerfile,Ac as removeTempDir,Za as registryVersionsForPlatform,Ya as registryPlatformKey,_a as registryDownloadSource,Eb as readProjectDependencies,W as readPantryPackageInfo,pb as rcFileFor,$b as pushImage,_b as pullImage,jc as provisionMacApp,ta as pkg,o as parseVersion,la as parsePackageSpec,cb as parseInstallerConstraint,Zb as parseImageRef,Nb as parseFreezer,Lb as parseExecForm,Kb as parseDockerfile,Ia as parseDepsYamlConfig,Ha as parseDependencyFile,b as pantry,c as packages,Qa as normalizeInstallerVersion,B as logPkgxProjects,Pb as loadFreezer,xa as listPopularPackages,za as listAliases,ya as listActivePackages,g as isVersionAvailable,fa as isValidPackageName,ga as isSupportedPlatform,ha as isSupportedArchitecture,kb as isSupported,hb as isRetryableNetworkError,ra as isPackageInCategory,ea as isPackageDomain,da as isPackageAlias,_ as isNewerVersion,I as isKnownAlias,lb as isInstallable,$a as installedRegistryBinaries,rb as installShellInit,Wa as installPackages,Va as installPackage,F as guessOriginalDomain,Ra as globalBinDir,Ca as getVersionInfo,M as getValidCachedPackage,Ga as getSystemInfo,nb as getPrimaryBinary,l as getPopularPackages,f as getPhpVersionsForWorkflow,k as getPackagesByPattern,qa as getPackagesByCategory,i as getPackageInfo,H as getPackageAliases,d as getLatestVersion,Db as getInstallCommand,y as getGitHubPackageCache,J as getCanonicalDomain,Ja as getAvailableVersionsForPackage,e as getAvailableVersions,ja as getAllPackageDomains,ia as getAllPackageAliases,m as getActivePackages,kc as generateMacCertificateRequests,wb as generateIndex,yb as generateDocs,ec as generateContainerFiles,xb as generateAliases,Ea as formatSearchResults,ma as formatPackageSpec,Da as formatPackageInfo,C as formatObjectWithoutQuotedKeys,Fa as formatInstallPlan,Pa as findDependencyFiles,P as fetchPkgxProjects,X as fetchPantryPackageWithMetadata,Q as fetchPantryPackage,A as fetchPackageListFromGitHub,aa as fetchDesktopCatalogue,U as fetchAndSavePackage,T as fetchAndSaveAllPackages,bc as extractLayer,lc as exportAppleCertificateP12,hc as ensureAppStoreVersions,jb as downloadFileReliably,Sb as digestHex,Rb as digest,ob as detectShell,Sa as detectPlatform,ua as dependencies,Ib as definePantryConfig,Gb as definePackageList,Fb as defineDependencies,Na as deduplicateDependencies,Dc as createTestFile,Ec as createTestDir,zc as createTempDir,Ob as createMatcher,na as createInstallationContext,Ba as createInstallPlan,D as convertDomainToVarName,E as convertDomainToFileName,p as compareVersionsDesc,La as compareVersions,fb as compareInstallerVersionsDesc,Jb as collectBuildContext,O as cleanupBrowserResources,L as cleanStaleOutputFiles,ba as checkAppUpdates,Vb as buildManifest,Tb as buildLayerFromRootfs,cc as buildImage,fc as appStoreConnectToken,a as aliases,oa as VERSION_SPECS,Y as SYSTEM_APPS,mc as PantryService,Yb as PANTRY_REGISTRY,pa as PACKAGE_CATEGORIES,u as PACKAGE_ALIASES,Qb as MEDIA_TYPE,Z as MAS_APPS,Hb as DISTRIBUTION_CONFIG,t as DEFAULT_TIMEOUT_MS,s as DEFAULT_CACHE_EXPIRATION_MINUTES,r as DEFAULT_CACHE_DIR,gc as AppStoreConnectClient,v as ALL_KNOWN_PACKAGES};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ph as F}from"./chunk-x1w6q9tk.js";var R=/^(?:build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(?:\([^)]+\))?!?: .+/;function Y(M,G){let P=R.test(M.trim());return{name:"title-format",mode:G,passed:P,summary:P?"Title follows conventional commit format":"Title does not follow conventional commit format",...P?{}:{detail:"Expected something like `feat(scope): add the thing` or `fix: correct the off-by-one`."}}}function B(M,G){let P=M.trim();if(P.length<20)return{name:"description",mode:G.mode,passed:!1,summary:"Description is missing or too short",detail:"Explain what changed and why, so a reviewer does not have to reconstruct it from the diff."};let z=(G.requireSections??[]).filter((j)=>!new RegExp(`^#{1,6}\\s*${w(j)}\\b`,"im").test(P));return{name:"description",mode:G.mode,passed:z.length===0,summary:z.length===0?"Description is complete":`Description is missing ${z.length} required section(s)`,...z.length>0?{detail:`Missing: ${z.map((j)=>`\`${j}\``).join(", ")}`}:{}}}function C(M,G){let P=[];for(let z of M??[]){if(G.blockVulnerable!==!1&&z.vulnerable)P.push(`\`${z.name}@${z.version}\` has a known vulnerability`);if(G.blockDeprecated!==!1&&z.deprecated)P.push(`\`${z.name}\` is deprecated`);if(G.blockEol!==!1&&z.eol)P.push(z.eol);if(G.licenseAllowlist?.length&&z.license){if(!G.licenseAllowlist.includes(z.license))P.push(`\`${z.name}\` is licensed \`${z.license}\`, which is not on the allowlist`)}}return{name:"dependency-gate",mode:G.mode,passed:P.length===0,summary:P.length===0?"Dependencies satisfy the configured policy":`${P.length} dependency policy violation(s)`,...P.length>0?{detail:P.map((z)=>`- ${z}`).join(`
|
|
3
3
|
`)}:{}}}function q(M,G){let P=[];if(G.titleFormat&&G.titleFormat!=="off")P.push(Y(M.title,G.titleFormat));if(G.description&&G.description.mode!=="off")P.push(B(M.body,G.description));if(G.dependencyGate&&G.dependencyGate.mode!=="off")P.push(C(M.dependencies,G.dependencyGate));return P}function S(M){if(M.length===0)return{conclusion:"neutral",title:"No checks configured",summary:"No pre-merge checks are enabled."};let G=M.filter((x)=>!x.passed&&x.mode==="error"),P=M.filter((x)=>!x.passed&&x.mode==="warning"),z=M.filter((x)=>x.neutral),j=M.map((x)=>{return`${H(x)} **${x.name}** \u2014 ${x.summary}${x.detail?`
|
|
4
4
|
|
|
5
5
|
${x.detail}
|