From d45b3dfdcfe1b40821b91490ec3c855d4aa9dfae Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Wed, 8 Nov 2023 09:56:11 +0100 Subject: [PATCH 1/2] Create snyk.yml --- .github/workflows/snyk.yml | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/snyk.yml diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml new file mode 100644 index 00000000..8a6d5c42 --- /dev/null +++ b/.github/workflows/snyk.yml @@ -0,0 +1,48 @@ +name: Snyk + +on: + merge_group: + workflow_dispatch: + pull_request_target: + types: + - opened + - synchronize + push: + branches: + - main + - frederikprijck-patch-2 + schedule: + - cron: '30 0 1,15 * *' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + authorize: + name: Authorize + environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} + runs-on: ubuntu-latest + steps: + - run: true + + check: + needs: authorize + + name: Check for Vulnerabilities + runs-on: ubuntu-latest + + steps: + - if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group' + run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection. + + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + + - uses: snyk/actions/node@b98d498629f1c368650224d6d212bf7dfa89e4bf # pin@0.4.0 + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} From 8cf801c33c91c8a1c8ba5e1d280a58cb6c6df4cb Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Wed, 8 Nov 2023 10:07:04 +0100 Subject: [PATCH 2/2] Update snyk.yml --- .github/workflows/snyk.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml index 8a6d5c42..0ebacbec 100644 --- a/.github/workflows/snyk.yml +++ b/.github/workflows/snyk.yml @@ -10,7 +10,6 @@ on: push: branches: - main - - frederikprijck-patch-2 schedule: - cron: '30 0 1,15 * *'