Skip to content

Commit 5bfee6d

Browse files
Fix workspace check (#3124)
* try and fix lerna workspace output parse * try and fix lerna workspace output parse * try and fix lerna workspace output parse
1 parent 4152aee commit 5bfee6d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.github/workflows/on-pull-request.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
- name: Create matrix
102102
id: set-matrix
103103
run: |
104+
npm install lerna -g
104105
matrix="$(node checkChangedWorkspaces.js)"
105106
echo "matrix=$matrix" >> $GITHUB_OUTPUT
106107
@@ -135,7 +136,7 @@ jobs:
135136
uses: actions/cache@v3
136137
id: yarn-cache
137138
with:
138-
path: ${{ env.CACHE_PATH }}
139+
path: ${{ env.CACHE_PATH }}
139140
key: e2e-cache-${{ steps.yarn-hash.outputs.yarnHash }}
140141

141142
- name: Check disk space before install
@@ -194,7 +195,7 @@ jobs:
194195
restore-keys: |
195196
e2e-cache-
196197
e2e-
197-
198+
198199
- name: Install deps
199200
if: steps.yarn-cache.outputs.cache-hit != 'true'
200201
env:

checkChangedWorkspaces.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
const { exec } = require("child_process");
2-
exec("yarn list:all", (error, stdout, stderr) => {
2+
exec("npx lerna ls --all --json", (error, stdout, stderr) => {
33
if (error) {
44
console.log(`error: ${error.message}`);
55
return;
66
}
7-
console.log('ou', stdout);
87
try {
98
const allPackages = JSON.parse(stdout);
10-
exec("yarn list:changed", (error, stdout, stderr) => {
9+
exec("npx lerna ls --all --since=origin/master --json", (error, stdout, stderr) => {
1110
if (error) {
1211
console.log(`error: ${error.message}`);
1312
return;

lerna.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"version": "0.0.0",
3-
"npmClient": "yarn",
4-
"useWorkspaces": true
3+
"npmClient": "yarn"
54
}

0 commit comments

Comments
 (0)