Skip to content

Commit 18dd2bd

Browse files
authored
Merge pull request #18 from link-foundation/issue-17-4fb92dabeabb
fix: correct package.json path in version-and-commit.mjs for monorepo
2 parents 9620f3c + c640475 commit 18dd2bd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'browser-commander': patch
3+
---
4+
5+
Fix package.json path in version-and-commit.mjs for monorepo structure
6+
7+
The git show command uses repository root paths, not the workflow's working directory. Since this is a monorepo with js/ and rust/ folders, the path must be js/package.json instead of just package.json.
8+
9+
This was causing "Unexpected end of JSON input" errors when the script tried to read package.json from the repository root (which doesn't exist) instead of js/package.json.

js/scripts/version-and-commit.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ function countChangesets() {
126126
*/
127127
async function getVersion(source = 'local') {
128128
if (source === 'remote') {
129-
const result = await $`git show origin/main:package.json`.run({
129+
// Use js/package.json for monorepo structure
130+
// The workflow runs with working-directory: js, but git show uses repo root paths
131+
const result = await $`git show origin/main:js/package.json`.run({
130132
capture: true,
131133
});
132134
return JSON.parse(result.stdout).version;

0 commit comments

Comments
 (0)