Skip to content

Bump the github-actions group with 8 updates #59

Bump the github-actions group with 8 updates

Bump the github-actions group with 8 updates #59

Workflow file for this run

# node.js.yml
name: Node.js CI
on:
push:
branches: [ "master" ]
paths:
- 'package.json'
- 'package-lock.json'
- 'Website/**'
- 'Template/**'
- 'DevProjects/**'
- '.github/workflows/node.js.yml'
pull_request:
branches: [ "master" ]
paths:
- 'package.json'
- 'package-lock.json'
- 'Website/**'
- 'Template/**'
- 'DevProjects/**'
- '.github/workflows/node.js.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x]
steps:
- uses: actions/checkout@v7
- name: Check for package.json
id: nodecheck
shell: bash
run: |
if [ -f "package.json" ]; then
echo "found=true" >> "$GITHUB_OUTPUT"
else
echo "found=false" >> "$GITHUB_OUTPUT"
echo "No root package.json found."
fi
- name: Use Node.js ${{ matrix.node-version }}
if: steps.nodecheck.outputs.found == 'true'
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
if: steps.nodecheck.outputs.found == 'true'
run: npm ci
- name: Build
if: steps.nodecheck.outputs.found == 'true'
run: npm run build --if-present
- name: Test
if: steps.nodecheck.outputs.found == 'true'
run: npm test --if-present
- name: Skip when no Node project exists
if: steps.nodecheck.outputs.found != 'true'
run: echo "No root package.json found. Skipping."