From 61f13c944616f0406704a10f2d4e70e0124e3bff Mon Sep 17 00:00:00 2001 From: Jagoda11 <31731113+Jagoda11@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:58:21 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80adding=20workflow=20for=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/npm-update.yml | 68 ++++++++++++++++++++++++++++++++ README.md | 3 +- 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/npm-update.yml diff --git a/.github/workflows/npm-update.yml b/.github/workflows/npm-update.yml new file mode 100644 index 0000000..ff74da2 --- /dev/null +++ b/.github/workflows/npm-update.yml @@ -0,0 +1,68 @@ +name: 🚀 Dependency Update and Vulnerability Scan + +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + push: + branches: + - master + +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 packages except ESLint + run: | + ncu -x eslint -u + npm install + npm install eslint@8.57.0 --save-dev + + - name: 📦 Update dependencies with legacy peer deps + run: npm update --legacy-peer-deps + + - name: 🐶 Install Husky + run: npx husky install + + - name: 🖋️ Format code + run: npm run format + + - name: 🎭 Mask Debricked credentials + run: | + echo "::add-mask::${{ secrets.DEBRICKED_TOKEN }}" + + - name: Install Debricked CLI + run: | + curl -L https://github.com/debricked/cli/releases/latest/download/cli_linux_x86_64.tar.gz | tar -xz debricked + sudo mv debricked /usr/local/bin/debricked + + - name: 🛡️ Debricked Vulnerability Scan + run: | + debricked scan -t ${{ secrets.DEBRICKED_TOKEN }} -r ${{ github.repository }} -c ${{ github.sha }} + + - 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 except ESLint ⬆️" + + - name: 🚀 Push changes + if: success() + run: git push \ No newline at end of file diff --git a/README.md b/README.md index 0f571e8..0fa993a 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,9 @@ ![GitHub Issues](https://img.shields.io/github/issues/Jagoda11/Angular-Bowling-Scorekeeper?style=flat-square&color=blue) ![Last Commit](https://img.shields.io/github/last-commit/Jagoda11/Angular-Bowling-Scorekeeper/master?style=flat-square&color=green) +![Build Status](https://github.com/Jagoda11/Angular-Bowling-Scorekeeper/actions/workflows/npm-update.yml/badge.svg?branch=master) -This project uses Angular version 9.1.3. - ## 📝 Description 📝 A game consists of ten frames. Frame 1-9 are composed of two rolls. Frame 10 can be composed of up to three rolls depending on if the first rolls in the frame is a strike or a spare.