Skip to content

Fix npm trusted publishing - upgrade npm CLI to latest. (#10) #37

Fix npm trusted publishing - upgrade npm CLI to latest. (#10)

Fix npm trusted publishing - upgrade npm CLI to latest. (#10) #37

Workflow file for this run

name: Lint and Format
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: '22'
- name: Install dependencies
run: npm ci
- name: Check package-lock.json is up to date
run: |
npm install --package-lock-only
if [ -n "$(git status --porcelain package-lock.json)" ]; then
echo "Error: package-lock.json is out of date. Please run 'npm install' locally and commit the changes."
git diff package-lock.json
exit 1
fi
- name: Run linting and typecheck
run: npm run lint
- name: Run formatting
run: npm run format
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: Files were modified by formatting. Please run 'npm run format' locally and commit the changes."
git status --porcelain
git diff
exit 1
fi