| 174 | } |
| 175 | |
| 176 | function protectMain(owner, repoName) { |
| 177 | const protection = { |
| 178 | required_status_checks: { |
| 179 | strict: true, |
| 180 | contexts: ['ci'], |
| 181 | }, |
| 182 | enforce_admins: false, |
| 183 | required_pull_request_reviews: null, |
| 184 | restrictions: null, |
| 185 | allow_force_pushes: false, |
| 186 | allow_deletions: false, |
| 187 | }; |
| 188 | gh(['api', '-X', 'PUT', `repos/${owner}/${repoName}/branches/main/protection`, '--input', '-'], { |
| 189 | input: JSON.stringify(protection), |
| 190 | }); |
| 191 | } |
| 192 | |
| 193 | function createAgentPr(workDir, owner, repoName, number) { |
| 194 | const branch = `agent/${number}`; |