Skip to content

npm-audit

npm-audit #21

Workflow file for this run

on:
workflow_dispatch:
schedule:
# every Monday morning
- cron: '0 1 * * 1'
name: npm-audit
jobs:
findPackages:
runs-on: ubuntu-latest
outputs:
nodePaths: ${{ steps.interrogate.outputs.nodePaths }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
fetch-depth: 0
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
with:
node-version: 18
- id: interrogate
run: node ./.github/workflows/list-node-paths-for-deps.js
updateDeps:
runs-on: ubuntu-latest
needs: findPackages
strategy:
fail-fast: false
max-parallel: 4
matrix:
package: ${{fromJson(needs.findPackages.outputs.nodePaths)}}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
with:
node-version: 18
- run: echo ./packages/${{ matrix.package }}
- run: cd ./packages/${{ matrix.package }} && npm audit fix
continue-on-error: true
- uses: googleapis/code-suggester@9c92ffb751cbdc880473aa650013b3a3292f743a # v4
env:
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
with:
command: pr
upstream_owner: googleapis
upstream_repo: repo-automation-bots
description: 'ran `npm audit fix` in packages/${{ matrix.package }}'
title: 'chore: update lock file for ${{ matrix.package }}'
message: 'chore: update lock file for ${{ matrix.package }}'
branch: update-lock-file-${{ matrix.package }}
primary: main
force: true
git_dir: '.'