mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Upgrade @actions/* packages (#40)
This commit is contained in:
+2
-2
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user