Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to GitHub Pro or make this repository public to enable this feature #1229

Closed
0x2b3bfa0 opened this issue Oct 15, 2022 · 0 comments · Fixed by #1230
Closed

Upgrade to GitHub Pro or make this repository public to enable this feature #1229

0x2b3bfa0 opened this issue Oct 15, 2022 · 0 comments · Fixed by #1230
Assignees
Labels
bug Something isn't working cml-pr Subcommand

Comments

@0x2b3bfa0
Copy link
Member

On private repositories, cml pr --{squash,rebase,merge} may fail without GitHub Pro:

Upgrade to GitHub Pro or make this repository public to enable this feature
GET gttps://api.github.com/repos/:user/:repository/branches/main/protection
{"level":"error","message":"Upgrade to GitHub Pro or make this repository public to enable this feature.","name":"HttpError","request":{"headers":{"accept":"application/vnd.github.v3+json","authorization":"token [REDACTED]","user-agent":"octokit-rest.js/18.0.0 octokit-core.js/3.6.0 Node.js/16.17.1 (linux; x64)"},"method":"GET","request":{"agent":{}},"url":"https://api.github.com/repos/[REDACTED]/[REDACTED]/branches/main/protection"},"response":{"data":{"documentation_url":"https://docs.github.com/rest/reference/repos#get-branch-protection","message":"Upgrade to GitHub Pro or make this repository public to enable this feature."},"headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","connection":"close","content-encoding":"gzip","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Sat, 15 Oct 2022 18:21:50 GMT","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"GitHub.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","transfer-encoding":"chunked","vary":"Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-media-type":"github.v3; format=json","x-github-request-id":"0604:8A70:526606A:A8B5A48:634AFA3E","x-ratelimit-limit":"1000","x-ratelimit-remaining":"996","x-ratelimit-reset":"1665861706","x-ratelimit-resource":"core","x-ratelimit-used":"4","x-xss-protection":"0"},"status":403,"url":"https://api.github.com/repos/[REDACTED]/[REDACTED]/branches/main/protection"},"stack":"HttpError: Upgrade to GitHub Pro or make this repository public to enable this feature.\n    at /usr/local/lib/node_modules/@dvcorg/cml/node_modules/@octokit/request/dist-node/index.js:86:21\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async Job.doExecute (/usr/local/lib/node_modules/@dvcorg/cml/node_modules/bottleneck/light.js:405:18)","status":403}

cml/src/drivers/github.js

Lines 445 to 457 in 68cc1b4

try {
await octo.repos.getBranchProtection({
branch,
owner,
repo
});
return true;
} catch (error) {
if (error.message === 'Branch not protected') {
return false;
}
throw error;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cml-pr Subcommand
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant