Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions #717

Potential fix for code scanning alert no. 1: Workflow does not contain permissions

Potential fix for code scanning alert no. 1: Workflow does not contain permissions #717

Workflow file for this run

name: Test
permissions:
contents: read
actions: write
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [22.x, 23.x, 24.x]
name: Node ${{ matrix.node-version }} - ${{ matrix.os }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id }}
with:
access_token: ${{ github.token }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Cache node modules
uses: actions/cache@v5
with:
path: ~/.npm
key: ${{ matrix.os }}-${{ matrix.node-version }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.node-version }}-npm-
${{ matrix.os }}-npm-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run typecheck
- run: npm run test:all