@@ -2,7 +2,6 @@ name: Snyk
22
33on :
44 merge_group :
5- workflow_dispatch :
65 pull_request_target :
76 types :
87 - opened
1615permissions :
1716 contents : read
1817
18+ env :
19+ DX_SDKS_SNYK_ORGANIZATION : 8303ea71-ac72-4ae6-9cd0-ae2f3eda82b7
20+ DX_SDKS_SNYK_PROJECT : auth0/laravel-auth0
21+ DX_SDKS_SNYK_TAGS : Refactoring-target:DX,Refactoring-origin:auth0-sdks
22+ DX_SDKS_SNYK_REMOTE_REPO_URL : https://github.com/auth0/laravel-auth0
23+
1924concurrency :
2025 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2126 cancel-in-progress : ${{ github.ref != 'refs/heads/main' }}
@@ -28,24 +33,56 @@ jobs:
2833 steps :
2934 - run : true
3035
36+ configure :
37+ name : Configure
38+ needs : [authorize]
39+ runs-on : ubuntu-latest
40+
41+ outputs :
42+ matrix : ${{ steps.set-matrix.outputs.matrix }}
43+
44+ steps :
45+ - uses : actions/checkout@v4
46+ with :
47+ ref : ${{ github.event.pull_request.merge_commit_sha || github.ref }}
48+
49+ - id : set-matrix
50+ run : echo "matrix=$(jq -c . < ./.github/workflows/matrix.json)" >> $GITHUB_OUTPUT
51+
3152 check :
32- needs : authorize
53+ needs : [configure]
3354
3455 name : Check for Vulnerabilities
3556 runs-on : ubuntu-latest
3657
3758 steps :
3859 - if : github.actor == 'dependabot[bot]' || github.event_name == 'merge_group'
39- 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.
60+ run : exit 0
4061
41- - uses : actions/checkout@v3
62+ - uses : actions/checkout@v4
4263 with :
43- ref : ${{ github.event.pull_request.head.sha || github.ref }}
64+ ref : ${{ github.event.pull_request.merge_commit_sha || github.ref }}
4465
4566 - uses : ./.github/actions/setup
4667 with :
47- php : 8.1
68+ php : ${{ fromJson(needs.configure.outputs.matrix).include[0].php }}
69+
70+ - run : npm install snyk -g
71+
72+ - if : github.ref == 'refs/heads/main'
73+ run : snyk monitor --file=composer.lock --org=$SNYK_ORGANIZATION --project-name=$SNYK_PROJECT --project-tags=$SNYK_TAGS --remote-repo-url=$SNYK_REMOTE_REPO --target-reference="$(git branch --show-current)"
74+ env :
75+ SNYK_TOKEN : ${{ secrets.DX_SDKS_SNYK_TOKEN }}
76+ SNYK_ORGANIZATION : ${{ env.DX_SDKS_SNYK_ORGANIZATION }}
77+ SNYK_PROJECT : ${{ env.DX_SDKS_SNYK_PROJECT }}
78+ SNYK_TAGS : ${{ env.DX_SDKS_SNYK_TAGS }}
79+ SNYK_REMOTE_REPO : ${{ env.DX_SDKS_SNYK_REMOTE_REPO_URL }}
80+ continue-on-error : true
4881
49- - uses : snyk/actions/php@b98d498629f1c368650224d6d212bf7dfa89e4bf # pin@0.4.0
82+ - run : snyk test --file=composer.lock --org=$SNYK_ORGANIZATION --project-name=$SNYK_PROJECT --remote-repo-url=$SNYK_REMOTE_REPO
5083 env :
51- SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
84+ SNYK_TOKEN : ${{ secrets.DX_SDKS_SNYK_TOKEN }}
85+ SNYK_ORGANIZATION : ${{ env.DX_SDKS_SNYK_ORGANIZATION }}
86+ SNYK_PROJECT : ${{ env.DX_SDKS_SNYK_PROJECT }}
87+ SNYK_TAGS : ${{ env.DX_SDKS_SNYK_TAGS }}
88+ SNYK_REMOTE_REPO : ${{ env.DX_SDKS_SNYK_REMOTE_REPO_URL }}
0 commit comments