mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Validate that projects use Changesets CLI v3 and direct Changesets CLI v2 users to changesets/action@v1 (#699)
* Validate that projects use Changesets CLI v3 and direct Changesets CLI v2 users to `changesets/action@v1` * better spy/mocking * fmt * shuffle
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import * as core from "@actions/core";
|
||||
import { GitHub } from "../github.ts";
|
||||
import { runVersion } from "../run.ts";
|
||||
import { getOptionalInput, getRequiredInput } from "../utils.ts";
|
||||
import {
|
||||
getOptionalInput,
|
||||
getRequiredInput,
|
||||
validateChangesetsCliVersion,
|
||||
} from "../utils.ts";
|
||||
|
||||
try {
|
||||
await main();
|
||||
@@ -10,6 +14,10 @@ try {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// If the user needs to change the cwd, set `working-directory` in the step instead
|
||||
const cwd = process.cwd();
|
||||
await validateChangesetsCliVersion(cwd);
|
||||
|
||||
const githubToken = getRequiredInput("github-token");
|
||||
const script = getOptionalInput("script");
|
||||
const commitMessage = getRequiredInput("commit-message");
|
||||
@@ -27,9 +35,6 @@ async function main() {
|
||||
throw new Error(`Invalid commit-mode input: ${commitMode}`);
|
||||
}
|
||||
|
||||
// If the user needs to change the cwd, set `working-directory` in the step instead
|
||||
const cwd = process.cwd();
|
||||
|
||||
const github = new GitHub({
|
||||
cwd,
|
||||
githubToken,
|
||||
|
||||
Reference in New Issue
Block a user