Skip to content

Commit

Permalink
chore: add GH Action, on Snyk PRs commit yarn.lock (#9534)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanh committed Mar 15, 2024
1 parent 09302e6 commit bd907a9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/snyk-yarn-lock-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Update Snyk PR to add yarn.lock

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
update-snyk-pr:
if: contains(github.event.pull_request.title.toLowerCase(), '[snyk]')
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, no need to create one

- name: Install dependencies
run: yarn install

- name: Commit yarn.lock to the PR branch
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git add yarn.lock
git commit -m "Update yarn.lock" || echo "No changes to commit"
git push

0 comments on commit bd907a9

Please sign in to comment.