Skip to content

Commit d7b4d28

Browse files
committed
ci(ts): guarded Node job (pnpm cache); skip cleanly when no package.json
1 parent 4d9600e commit d7b4d28

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,32 @@ jobs:
3535
python-version: ${{ matrix.python }}
3636
- name: Smoke
3737
run: python -V
38-
# ci:nudge 20250917T164347Z
38+
# ci:nudge 20250917T164347Z
39+
40+
ts:
41+
name: "ts / node 22.x • ubuntu-latest"
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- name: Detect Node workspace
46+
id: guard
47+
shell: bash
48+
run: |
49+
if find . -type f -name package.json -print -quit | grep -q .; then
50+
echo "HAS_NODE=1" >> "$GITHUB_ENV"
51+
else
52+
echo "HAS_NODE=0" >> "$GITHUB_ENV"
53+
fi
54+
- if: ${{ env.HAS_NODE == '1' }}
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: 22.x
58+
cache: pnpm
59+
- if: ${{ env.HAS_NODE == '1' }}
60+
run: corepack enable || true
61+
- if: ${{ env.HAS_NODE == '1' }}
62+
run: pnpm -v && (pnpm i --frozen-lockfile || true)
63+
- if: ${{ env.HAS_NODE == '1' }}
64+
run: pnpm -s test || echo "no tests"
65+
- if: ${{ env.HAS_NODE == '0' }}
66+
run: echo "No package.json found. Skipping TS job."

0 commit comments

Comments
 (0)