Skip to content

Commit e012872

Browse files
committed
trying to fix pr code check
1 parent c9d6d7b commit e012872

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/pr-check-code.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,36 @@ on:
44
pull_request:
55
paths:
66
- "subgraphs/**"
7+
78
jobs:
9+
define-matrix:
10+
runs-on: ubuntu-latest
11+
12+
outputs:
13+
subgraphs: ${{ steps.subgraphs.outputs.subgraphs }}
14+
steps:
15+
- name: Define Subgraphs
16+
id: subgraphs
17+
run: |
18+
# Find all subfolders except "node_modules" and convert them into an array
19+
subfolders=($(find subgraphs -mindepth 1 -maxdepth 1 -type d ! -name "node_modules" -exec basename {} \;))
20+
21+
# Print the array
22+
echo "subgraphs=$(printf '%s\n' "${subfolders[@]}" | jq -R . | jq -s -c .)" >> "$GITHUB_OUTPUT"
823
npm-build:
924
runs-on: ubuntu-latest
25+
needs: define-matrix
26+
strategy:
27+
matrix:
28+
subgraphs: ${{ fromJson(needs.define-matrix.outputs.subgraphs) }}
1029
steps:
1130
- uses: actions/checkout@v4
12-
1331
- uses: actions/setup-node@v4
1432
with:
1533
node-version: 22.x
1634
cache: "npm"
17-
35+
- name: Change directory
36+
run: cd subgraphs/${{ matrix.subgraphs }}
1837
- run: npm ci
19-
2038
- run: npm run build
2139

0 commit comments

Comments
 (0)