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 -2
View File
@@ -7,6 +7,7 @@ import {
downloadArtifact,
execChangesetsCli,
getOptionalInput,
validateChangesetsCliVersion,
} from "../utils.ts";
try {
@@ -16,10 +17,12 @@ try {
}
async function main() {
const publishPlanArtifactId = getOptionalInput("publish-plan-artifact-id");
// If the user needs to change the cwd, set `working-directory` in the step instead
const cwd = process.cwd();
await validateChangesetsCliVersion(cwd);
const publishPlanArtifactId = getOptionalInput("publish-plan-artifact-id");
const tmpDir = process.env.RUNNER_TEMP ?? (await fs.realpath(os.tmpdir()));
const outDir = path.join(tmpDir, `changeset-pack-${Date.now()}`);