Skip to content

Commit

Permalink
fix: adapt for githubs new default branch: main (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Oct 7, 2020
1 parent 3d0fd87 commit b0c6d2c
Show file tree
Hide file tree
Showing 12 changed files with 650 additions and 650 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
update_prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
version: 12
Expand Down
2 changes: 1 addition & 1 deletion lib/to-entity-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = toEntityName;

function toEntityName(object, fixture) {
// object is binary response, so we check for it above the object check
if (/\/legacy\.(tar\.gz|zip)\/master$/.test(fixture.path)) {
if (/\/legacy\.(tar\.gz|zip)\/main$/.test(fixture.path)) {
return "archive";
}

Expand Down
12 changes: 6 additions & 6 deletions scenarios/api.github.com/create-file/normalized-fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"path": "test.txt",
"sha": "3f3f005b29247e51a4f4d6b8ce07b67646cd6074",
"size": 12,
"url": "https://api.github.com/repos/octokit-fixture-org/create-file/contents/test.txt?ref=master",
"html_url": "https://github.com/octokit-fixture-org/create-file/blob/master/test.txt",
"url": "https://api.github.com/repos/octokit-fixture-org/create-file/contents/test.txt?ref=main",
"html_url": "https://github.com/octokit-fixture-org/create-file/blob/main/test.txt",
"git_url": "https://api.github.com/repos/octokit-fixture-org/create-file/git/blobs/3f3f005b29247e51a4f4d6b8ce07b67646cd6074",
"download_url": "https://raw.githubusercontent.com/octokit-fixture-org/create-file/master/test.txt",
"download_url": "https://raw.githubusercontent.com/octokit-fixture-org/create-file/main/test.txt",
"type": "file",
"_links": {
"self": "https://api.github.com/repos/octokit-fixture-org/create-file/contents/test.txt?ref=master",
"self": "https://api.github.com/repos/octokit-fixture-org/create-file/contents/test.txt?ref=main",
"git": "https://api.github.com/repos/octokit-fixture-org/create-file/git/blobs/3f3f005b29247e51a4f4d6b8ce07b67646cd6074",
"html": "https://github.com/octokit-fixture-org/create-file/blob/master/test.txt"
"html": "https://github.com/octokit-fixture-org/create-file/blob/main/test.txt"
}
},
"commit": {
Expand Down Expand Up @@ -64,7 +64,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": "1750",
"content-length": "1740",
"content-security-policy": "default-src 'none'",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 10 Oct 2017 16:00:00 GMT",
Expand Down
174 changes: 87 additions & 87 deletions scenarios/api.github.com/create-file/raw-fixture.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions scenarios/api.github.com/get-archive/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/get-archive/tarball/master",
"path": "/repos/octokit-fixture-org/get-archive/tarball/main",
"body": "",
"status": 302,
"response": "",
Expand All @@ -22,7 +22,7 @@
"content-type": "text/html;charset=utf-8",
"date": "Tue, 10 Oct 2017 16:00:00 GMT",
"expires": "Tue, 10 Oct 2017 16:00:00 GMT",
"location": "https://codeload.github.com/octokit-fixture-org/get-archive/legacy.tar.gz/master",
"location": "https://codeload.github.com/octokit-fixture-org/get-archive/legacy.tar.gz/main",
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"status": "302 Found",
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
Expand All @@ -39,7 +39,7 @@
{
"scope": "https://codeload.github.com:443",
"method": "get",
"path": "/octokit-fixture-org/get-archive/legacy.tar.gz/master",
"path": "/octokit-fixture-org/get-archive/legacy.tar.gz/main",
"body": "",
"status": 200,
"response": "1f8b0800000000000003cb4f2ec9cfce2cd14dcbac28292d4ad5cd2f4ad74d4f2dd14d2c4acec82c4bd53580007d060a0050bfb9b9a90203c428741ac2313436343307222320dbc010a8dc5c81c194124b8905a5c525894540a714e5e797e05347481edd734304e41319ff41ae8e2ebeae7ab92964d801d46f66668227fe0d4d51e3dfc8d0c8d808284f75df6201233cfe951590627ba01d330a46c1281805a3806e000024cb59d6000a0000",
Expand Down
206 changes: 103 additions & 103 deletions scenarios/api.github.com/get-archive/raw-fixture.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scenarios/api.github.com/get-archive/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function getArchive(state) {
try {
await state.request({
method: "get",
url: `/repos/octokit-fixture-org/${temporaryRepository.name}/tarball/master`,
url: `/repos/octokit-fixture-org/${temporaryRepository.name}/tarball/main`,
headers: {
Accept: "application/vnd.github.v3+json",
Authorization: `token ${env.FIXTURES_USER_A_TOKEN_FULL_ACCESS}`,
Expand Down
4 changes: 2 additions & 2 deletions scenarios/api.github.com/get-archive/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test("Get archive", async (t) => {
const redirectLocation = await axios({
method: "get",
url:
"https://api.github.com/repos/octokit-fixture-org/get-archive/tarball/master",
"https://api.github.com/repos/octokit-fixture-org/get-archive/tarball/main",
headers: {
Accept: "application/vnd.github.v3+json",
Authorization: "token 0000000000000000000000000000000000000001",
Expand All @@ -31,7 +31,7 @@ test("Get archive", async (t) => {

t.is(
redirectLocation,
"https://codeload.github.com/octokit-fixture-org/get-archive/legacy.tar.gz/master"
"https://codeload.github.com/octokit-fixture-org/get-archive/legacy.tar.gz/main"
);

const result = await axios({
Expand Down
12 changes: 6 additions & 6 deletions scenarios/api.github.com/git-refs/normalized-fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"status": 200,
"response": [
{
"ref": "refs/heads/master",
"ref": "refs/heads/main",
"node_id": "MDA6RW50aXR5MQ==",
"url": "https://api.github.com/repos/octokit-fixture-org/git-refs/git/refs/heads/master",
"url": "https://api.github.com/repos/octokit-fixture-org/git-refs/git/refs/heads/main",
"object": {
"sha": "0000000000000000000000000000000000000001",
"type": "commit",
Expand All @@ -28,7 +28,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": "341",
"content-length": "337",
"content-security-policy": "default-src 'none'",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 10 Oct 2017 16:00:00 GMT",
Expand Down Expand Up @@ -163,9 +163,9 @@
"status": 200,
"response": [
{
"ref": "refs/heads/master",
"ref": "refs/heads/main",
"node_id": "MDA6RW50aXR5MQ==",
"url": "https://api.github.com/repos/octokit-fixture-org/git-refs/git/refs/heads/master",
"url": "https://api.github.com/repos/octokit-fixture-org/git-refs/git/refs/heads/main",
"object": {
"sha": "0000000000000000000000000000000000000001",
"type": "commit",
Expand Down Expand Up @@ -194,7 +194,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": "677",
"content-length": "673",
"content-security-policy": "default-src 'none'",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 10 Oct 2017 16:00:00 GMT",
Expand Down

0 comments on commit b0c6d2c

Please sign in to comment.