# This file is automatically added by @npmcli/template-oss. Do not edit.

name: Audit

on:
  workflow_dispatch:
  schedule:
    # "At 08:00 UTC (01:00 PT) on Monday" https://crontab.guru/#0_8_*_*_1
    - cron: "0 8 * * 1"

permissions:
  contents: read

jobs:
  audit:
    name: Audit Dependencies
    if: github.repository_owner == 'npm'
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Git User
        run: |
          git config --global user.email "npm-cli+bot@github.com"
          git config --global user.name "npm CLI robot"
      - name: Setup Node
        uses: actions/setup-node@v4
        id: node
        with:
          node-version: 22.x
          check-latest: contains('22.x', '.x')
      - name: Install Latest npm
        uses: ./.github/actions/install-latest-npm
        with:
          node: ${{ steps.node.outputs.node-version }}
      - name: Install Dependencies
        run: npm i --ignore-scripts --no-audit --no-fund --package-lock
      - name: Run Production Audit
        run: npm audit --omit=dev
      - name: Run Full Audit
        run: npm audit --audit-level=none
