From ab612fb0b3b83019a6bef35815f3e91d10ca52a0 Mon Sep 17 00:00:00 2001 From: Hrishikesh Mahajan Date: Mon, 26 Aug 2024 02:26:36 +0530 Subject: [PATCH] chore: Add Snyk Update GitHub Actions workflow --- .github/workflows/snyk-update.yml | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/snyk-update.yml diff --git a/.github/workflows/snyk-update.yml b/.github/workflows/snyk-update.yml new file mode 100644 index 0000000..c3cda2c --- /dev/null +++ b/.github/workflows/snyk-update.yml @@ -0,0 +1,57 @@ +name: Snyk Update + +on: pull_request + +permissions: + checks: write + contents: write + pull-requests: write + +jobs: + snyk-update: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Checkout PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr checkout ${{ github.event.pull_request.number }} + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" # Specify the Node.js version you use + + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: "latest" # Specify the Bun version you want + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: "latest" # Specify the pnpm version you want + + - name: Install Bun dependencies + run: bun install -y + + - name: Update npm dependencies + run: npm install --package-lock-only + + - name: Update pnpm dependencies + run: pnpm install --no-frozen-lockfile --lockfile-only + + - name: Commit changes + run: | + git config user.name "snyk-bot" + git config user.email "snyk-bot@snyk.io" + git add . + git commit --amend --no-edit + + - name: Push changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: git push --force