name: Presubmits

on:
  push:
    branches:
    - main
    - master
  pull_request:
    branches:
    - main
    - master

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - name: Harden Runner
      uses: step-security/harden-runner@9b0655f430fba8c7001d4e38f8d4306db5c6e0ab # v1
      with:
        egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

    - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
    - uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # v2
    - run: npm install
    - run: npm test
