From cde1a0af523af217e781cafc9bddccd8bb122685 Mon Sep 17 00:00:00 2001 From: Thomas Boop <52323235+thboop@users.noreply.github.com> Date: Tue, 21 Jul 2020 11:33:05 -0400 Subject: [PATCH] Set main as the default branch (#527) * set main as the default branch * revert change to tool-cache default branch * use versions where applicable --- __tests__/github.proxy.test.ts | 8 ++++---- __tests__/github.test.ts | 14 +++++++------- package.json | 2 +- src/context.ts | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/__tests__/github.proxy.test.ts b/__tests__/github.proxy.test.ts index 5da0658..1dd3838 100644 --- a/__tests__/github.proxy.test.ts +++ b/__tests__/github.proxy.test.ts @@ -52,9 +52,9 @@ describe('@actions/github', () => { const branch = await octokit.repos.getBranch({ owner: 'actions', repo: 'toolkit', - branch: 'master' + branch: 'main' }) - expect(branch.data.name).toBe('master') + expect(branch.data.name).toBe('main') expect(proxyConnects).toEqual(['api.github.com:443']) }) @@ -88,9 +88,9 @@ describe('@actions/github', () => { const branch = await octokit.repos.getBranch({ owner: 'actions', repo: 'toolkit', - branch: 'master' + branch: 'main' }) - expect(branch.data.name).toBe('master') + expect(branch.data.name).toBe('main') expect(proxyConnects).toHaveLength(0) }) diff --git a/__tests__/github.test.ts b/__tests__/github.test.ts index 4e02c7b..b4abfc4 100644 --- a/__tests__/github.test.ts +++ b/__tests__/github.test.ts @@ -48,9 +48,9 @@ describe('@actions/github', () => { const branch = await octokit.repos.getBranch({ owner: 'actions', repo: 'toolkit', - branch: 'master' + branch: 'main' }) - expect(branch.data.name).toBe('master') + expect(branch.data.name).toBe('main') expect(proxyConnects).toHaveLength(0) }) @@ -63,9 +63,9 @@ describe('@actions/github', () => { const branch = await octokit.repos.getBranch({ owner: 'actions', repo: 'toolkit', - branch: 'master' + branch: 'main' }) - expect(branch.data.name).toBe('master') + expect(branch.data.name).toBe('main') expect(proxyConnects).toHaveLength(0) }) @@ -80,9 +80,9 @@ describe('@actions/github', () => { const branch = await octokit.repos.getBranch({ owner: 'actions', repo: 'toolkit', - branch: 'master' + branch: 'main' }) - expect(branch.data.name).toBe('master') + expect(branch.data.name).toBe('main') expect(proxyConnects).toHaveLength(0) // Invalid token @@ -92,7 +92,7 @@ describe('@actions/github', () => { await octokit.repos.getBranch({ owner: 'actions', repo: 'toolkit', - branch: 'master' + branch: 'main' }) } catch (err) { failed = true diff --git a/package.json b/package.json index c7f8993..96803f3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "github", "actions" ], - "homepage": "https://github.com/actions/toolkit/tree/master/packages/github", + "homepage": "https://github.com/actions/toolkit/tree/main/packages/github", "license": "MIT", "main": "lib/github.js", "types": "lib/github.d.ts", diff --git a/src/context.ts b/src/context.ts index 52efabb..4eb7054 100644 --- a/src/context.ts +++ b/src/context.ts @@ -1,4 +1,4 @@ -// Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/context.ts +// Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/main/src/context.ts import {WebhookPayload} from './interfaces' import {readFileSync, existsSync} from 'fs' import {EOL} from 'os'