github-community-projects / github-community-projects/safe-settings

Branch policy issue

Open
#571 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
921
Forks
226
Avg merge
18h 3m
Merged PRs (30d)
14

Description

branch policies have issue if you .github/settings doesn't have the same branch as repo.yml

```
ERROR (event): Error applying branch protection {"name":"HttpError","status":422,"response":{"url":"https://api.github.com/repos/CuroFinTechCorp/Web/branches/release%2F2324.0/protection","status":422,"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-length":"340","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 15 Dec 2023 06:35:50 GMT","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"GitHub.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept-Encoding, Accept, X-Requested-With","x-accepted-github-permissions":"administration=write","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; param=hellcat-preview.luke-cage-preview.zzzax-preview; format=json","x-github-request-id":"4D63:8AFE:27B0520:5243F58:657BF3C6","x-ratelimit-limit":"15000","x-ratelimit-remaining":"9397","x-ratelimit-reset":"1702623448","x-ratelimit-resource":"core","x-ratelimit-used":"5603","x-xss-protection":"0"},"data":{"message":"Invalid request.\n\nNo subschema in \"anyOf\" matched.\nNo subschema in \"oneOf\" matched.\nNot all subschemas of \"allOf\" matched.\nFor 'anyOf/1', {\"contexts\"=>[\"Web - Checkin\", \"validate_work_item\"]} is not a null.","documentation_url":"https://docs.github.com/rest/branches/branch-protection#update-branch-protection"}},"request":{"method":"PUT","url":"https://api.github.com/repos/CuroFinTechCorp/Web/branches/release%2F2324.0/protection","headers":{"accept":"application/vnd.github.hellcat-preview+json,application/vnd.github.luke-cage-preview+json,application/vnd.github.zzzax-preview+json","user-agent":"probot/12.3.1 octokit-core.js/3.5.1 Node.js/21","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":"{\"required_pull_request_reviews\":{\"required_approving_review_count\":2},\"required_status_checks\":{\"contexts\":[\"Web - Checkin\",\"validate_work_item\"]},\"enforce_admins\":true,\"restrictions\":{\"apps\":[\"curo-bot\"],\"teams\":[],\"users\":[]}}","request":{"retryCount":1}}}
0|safesettings | 2023-12-15T06:35:50: id: "2d45bba0-9b14-11ee-9186-75ad40e095c3"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.