Skip to content

Commit

Permalink
chore: Add Snyk Update GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hrishikesh-mahajan authored and ciscoviit committed Aug 25, 2024
1 parent b10ade8 commit a62e3b7
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/snyk-update.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a62e3b7

Please sign in to comment.