Skip to content

Commit

Permalink
ci: add bulk npm audit workflow (#5494)
Browse files Browse the repository at this point in the history
Also makes the individual `npm audit fix` workflow manual trigger only
  • Loading branch information
chingor13 committed Sep 10, 2024
1 parent 744f772 commit 713375a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/audit-bulk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
workflow_dispatch:
schedule:
# every Monday morning
- cron: '0 1 * * 1'
name: npm-audit-bulk
jobs:
updatePackages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 18
- run: |
# for each package-lock.json, run npm audit fix
for `find packages -type d -name node_modules -prune -o -name package-lock.json -print | grep -v test`
do
# ignore failures and continue
npm audit fix || true
done
- 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`'
title: 'chore: update lock files'
message: 'chore: update lock files'
branch: update-lock-file-all
primary: main
force: true
git_dir: '.'
3 changes: 0 additions & 3 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
on:
workflow_dispatch:
schedule:
# every Monday morning
- cron: '0 1 * * 1'
name: npm-audit
jobs:
findPackages:
Expand Down

0 comments on commit 713375a

Please sign in to comment.