Fix reading .changeset directory from path provided in cwd parameter (#502)

* Adding informational message about resolved `cwd` location

* Reading changesets information from provided folder

* Adding changeset information

* Apply suggestion from @Andarist

---------

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
This commit is contained in:
Oleksii Shytikov
2026-03-31 17:38:41 +02:00
committed by GitHub
co-authored by Mateusz Burzyński
parent a7c500273b
commit 6002dbd987
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@changesets/action": patch
---
Making sure that `.changeset` information is picked up, when `cwd` parameter is provided
+2 -1
View File
@@ -20,6 +20,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
} }
const cwd = path.resolve(getOptionalInput("cwd") ?? ""); const cwd = path.resolve(getOptionalInput("cwd") ?? "");
core.info(`using resolved cwd: ${cwd}`);
const octokit = setupOctokit(githubToken); const octokit = setupOctokit(githubToken);
const commitMode = getOptionalInput("commitMode") ?? "git-cli"; const commitMode = getOptionalInput("commitMode") ?? "git-cli";
@@ -45,7 +46,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
`machine github.com\nlogin github-actions[bot]\npassword ${githubToken}` `machine github.com\nlogin github-actions[bot]\npassword ${githubToken}`
); );
let { changesets } = await readChangesetState(); let { changesets } = await readChangesetState(cwd);
let publishScript = core.getInput("publish"); let publishScript = core.getInput("publish");
let hasChangesets = changesets.length !== 0; let hasChangesets = changesets.length !== 0;