-
-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (34 loc) · 1 KB
/
Copy pathaudit-fix.yml
File metadata and controls
42 lines (34 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Weekly Audit Fix
on:
schedule:
- cron: '0 9 * * 1' # Every Monday at 9am UTC
workflow_dispatch: # Manual trigger
permissions:
contents: write
jobs:
audit-fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: '20'
- run: npm ci
- name: Run npm audit fix
run: npm audit fix || true
- name: Check for changes
id: changes
run: |
if git diff --quiet package-lock.json; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push
if: steps.changes.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package-lock.json
git commit -m "fix: automated npm audit fix (weekly)"
git push