Skip to content

Commit

Permalink
fix(branch-protection): master branch is now main by default (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Oct 5, 2020
1 parent aa51758 commit 3d0fd87
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 220 deletions.
40 changes: 20 additions & 20 deletions scenarios/api.github.com/branch-protection/normalized-fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"scope": "https://api.github.com:443",
"method": "get",
"path": "/repos/octokit-fixture-org/branch-protection/branches/master/protection",
"path": "/repos/octokit-fixture-org/branch-protection/branches/main/protection",
"body": "",
"status": 404,
"response": {
Expand Down Expand Up @@ -42,7 +42,7 @@
{
"scope": "https://api.github.com:443",
"method": "put",
"path": "/repos/octokit-fixture-org/branch-protection/branches/master/protection",
"path": "/repos/octokit-fixture-org/branch-protection/branches/main/protection",
"body": {
"required_status_checks": null,
"required_pull_request_reviews": null,
Expand All @@ -51,9 +51,9 @@
},
"status": 200,
"response": {
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection",
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection",
"enforce_admins": {
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/enforce_admins",
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/enforce_admins",
"enabled": false
},
"required_linear_history": { "enabled": false },
Expand All @@ -73,7 +73,7 @@
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"cache-control": "private, max-age=60, s-maxage=60",
"connection": "close",
"content-length": "374",
"content-length": "370",
"content-security-policy": "default-src 'none'",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 10 Oct 2017 16:00:00 GMT",
Expand All @@ -97,7 +97,7 @@
{
"scope": "https://api.github.com:443",
"method": "put",
"path": "/repos/octokit-fixture-org/branch-protection/branches/master/protection",
"path": "/repos/octokit-fixture-org/branch-protection/branches/main/protection",
"body": {
"required_status_checks": { "strict": true, "contexts": ["foo/bar"] },
"required_pull_request_reviews": {
Expand All @@ -116,18 +116,18 @@
},
"status": 200,
"response": {
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection",
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection",
"required_status_checks": {
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/required_status_checks",
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/required_status_checks",
"strict": true,
"contexts": ["foo/bar"],
"contexts_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/required_status_checks/contexts"
"contexts_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/required_status_checks/contexts"
},
"restrictions": {
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/restrictions",
"users_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/restrictions/users",
"teams_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/restrictions/teams",
"apps_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/restrictions/apps",
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/restrictions",
"users_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/restrictions/users",
"teams_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/restrictions/teams",
"apps_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/restrictions/apps",
"users": [
{
"login": "octokit-fixture-user-a",
Expand Down Expand Up @@ -169,13 +169,13 @@
"apps": []
},
"required_pull_request_reviews": {
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/required_pull_request_reviews",
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/required_pull_request_reviews",
"dismiss_stale_reviews": true,
"require_code_owner_reviews": false,
"dismissal_restrictions": {
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/dismissal_restrictions",
"users_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/dismissal_restrictions/users",
"teams_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/dismissal_restrictions/teams",
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/dismissal_restrictions",
"users_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/dismissal_restrictions/users",
"teams_url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/dismissal_restrictions/teams",
"users": [
{
"login": "octokit-fixture-user-a",
Expand All @@ -202,7 +202,7 @@
}
},
"enforce_admins": {
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/master/protection/enforce_admins",
"url": "https://api.github.com/repos/octokit-fixture-org/branch-protection/branches/main/protection/enforce_admins",
"enabled": true
},
"required_linear_history": { "enabled": false },
Expand All @@ -222,7 +222,7 @@
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"cache-control": "private, max-age=60, s-maxage=60",
"connection": "close",
"content-length": "4620",
"content-length": "4596",
"content-security-policy": "default-src 'none'",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 10 Oct 2017 16:00:00 GMT",
Expand All @@ -246,7 +246,7 @@
{
"scope": "https://api.github.com:443",
"method": "delete",
"path": "/repos/octokit-fixture-org/branch-protection/branches/master/protection",
"path": "/repos/octokit-fixture-org/branch-protection/branches/main/protection",
"body": "",
"status": 204,
"response": "",
Expand Down

0 comments on commit 3d0fd87

Please sign in to comment.