Skip to content

🚀 Dependency Update and Vulnerability Scan #8

🚀 Dependency Update and Vulnerability Scan

🚀 Dependency Update and Vulnerability Scan #8

name: 🚀 Dependency Update and Vulnerability Scan
on:
schedule:
- cron: '0 0 1 * *' # Runs monthly
workflow_dispatch:
jobs:
update-and-scan:
runs-on: ubuntu-latest
steps:
- name: 🛠️ Checkout code
uses: actions/checkout@v4
- name: 🔧 Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 🗑️ Remove package-lock.json
run: rm -f package-lock.json
- name: 📦 Install npm-check-updates
run: npm install -g npm-check-updates
- name: ⬆️ Update all npm packages
run: |
ncu -u
npm install --legacy-peer-deps
- name: 🏗️ Build project
run: npm run build
- name: ✅ Run tests
run: npm test
- name: 📝 Commit changes
if: ${{ success() }}
run: |
git config --local user.name "Debugging Duck 🦆"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff-index --quiet HEAD || git commit -m "⬆️ update all npm dependencies ⬆️"
- name: 🚀 Push changes
if: ${{ success() }}
run: git push