Upgrade @actions/* packages (#40)

This commit is contained in:
Mateusz Burzyński
2020-07-06 20:33:19 +10:00
committed by GitHub
parent d846247242
commit 2c7afd615c
5 changed files with 202 additions and 320 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ jest.mock("@actions/github", () => ({
ref: "refs/heads/some-branch",
sha: "xeac7",
},
GitHub: jest.fn(),
getOctokit: jest.fn(),
}));
jest.mock("./gitUtils");
@@ -30,7 +30,7 @@ let mockedGithubMethods = {
createRelease: jest.fn(),
},
};
(github.GitHub as any).mockImplementation(() => mockedGithubMethods);
(github.getOctokit as any).mockImplementation(() => mockedGithubMethods);
let f = fixturez(__dirname);
+3 -3
View File
@@ -15,7 +15,7 @@ import * as gitUtils from "./gitUtils";
import readChangesetState from "./readChangesetState";
const createRelease = async (
octokit: github.GitHub,
octokit: ReturnType<typeof github.getOctokit>,
{ pkg, tagName }: { pkg: Package; tagName: string }
) => {
try {
@@ -69,7 +69,7 @@ export async function runPublish({
cwd = process.cwd(),
}: PublishOptions): Promise<PublishResult> {
let branch = github.context.ref.replace("refs/heads/", "");
let octokit = new github.GitHub(githubToken);
let octokit = github.getOctokit(githubToken);
let [publishCommand, ...publishArgs] = script.split(/\s+/);
let changesetPublishOutput = await execWithOutput(
@@ -160,7 +160,7 @@ export async function runVersion({
let repo = `${github.context.repo.owner}/${github.context.repo.repo}`;
let branch = github.context.ref.replace("refs/heads/", "");
let versionBranch = `changeset-release/${branch}`;
let octokit = new github.GitHub(githubToken);
let octokit = github.getOctokit(githubToken);
let { preState } = await readChangesetState(cwd);
await gitUtils.switchToMaybeExistingBranch(versionBranch);