Skip to content

Commit eeeed8b

Browse files
update workflow for md changes only (#3042)
Co-authored-by: Josh Mock <[email protected]>
1 parent 211fa2a commit eeeed8b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/nodejs.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
name: Test
2727
runs-on: ${{ matrix.os }}
2828
needs: paths-filter
29-
# only run if code relevant to unit tests was changed
30-
if: needs.paths-filter.outputs.src-only == 'true'
29+
env:
30+
CODE_CHANGED: ${{ needs.paths-filter.outputs.src-only }}
3131

3232
strategy:
3333
fail-fast: false
@@ -51,15 +51,15 @@ jobs:
5151
5252
- name: Lint
5353
run: |
54-
npm run lint
54+
[ "$CODE_CHANGED" = "true" ] && npm run lint || exit 0
5555
5656
- name: Unit test
5757
run: |
58-
npm run test:unit
58+
[ "$CODE_CHANGED" = "true" ] && npm run test:unit || exit 0
5959
6060
- name: ECMAScript module test
6161
run: |
62-
npm run test:esm
62+
[ "$CODE_CHANGED" = "true" ] && npm run test:esm || exit 0
6363
6464
license:
6565
name: License check
@@ -90,8 +90,8 @@ jobs:
9090
name: Test Bun
9191
runs-on: ${{ matrix.os }}
9292
needs: paths-filter
93-
# only run if code relevant to unit tests was changed
94-
if: needs.paths-filter.outputs.src-only == 'true'
93+
env:
94+
CODE_CHANGED: ${{ needs.paths-filter.outputs.src-only }}
9595

9696
strategy:
9797
fail-fast: false
@@ -112,12 +112,12 @@ jobs:
112112
113113
- name: Lint
114114
run: |
115-
bun run lint
115+
[ "$CODE_CHANGED" = "true" ] && bun run lint || exit 0
116116
117117
- name: Unit test
118118
run: |
119-
bun run test:unit-bun
119+
[ "$CODE_CHANGED" = "true" ] && bun run test:unit-bun || exit 0
120120
121121
- name: ECMAScript module test
122122
run: |
123-
bun run test:esm
123+
[ "$CODE_CHANGED" = "true" ] && bun run test:esm || exit 0

0 commit comments

Comments
 (0)