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:
Mateusz Burzyński
2026-07-23 09:34:32 +00:00
committed by GitHub
parent 84d78c68f9
commit 5b307d3df2
9 changed files with 143 additions and 23 deletions
+5 -3
View File
@@ -7,6 +7,7 @@ import {
downloadArtifact,
getOptionalInput,
getRequiredInput,
validateChangesetsCliVersion,
} from "../utils.ts";
try {
@@ -16,6 +17,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 packDirArtifactId = getOptionalInput("pack-dir-artifact-id");
@@ -30,9 +35,6 @@ async function main() {
);
}
// If the user needs to change the cwd, set `working-directory` in the step instead
const cwd = process.cwd();
// NOTE: Always use API mode here as publish does not need a commit-mode.
const github = new GitHub({ cwd, githubToken, commitMode: "github-api" });