@@ -2,7 +2,6 @@ name: Snyk
2
2
3
3
on :
4
4
merge_group :
5
- workflow_dispatch :
6
5
pull_request_target :
7
6
types :
8
7
- opened
16
15
permissions :
17
16
contents : read
18
17
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
+
19
24
concurrency :
20
25
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21
26
cancel-in-progress : ${{ github.ref != 'refs/heads/main' }}
@@ -28,24 +33,56 @@ jobs:
28
33
steps :
29
34
- run : true
30
35
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
+
31
52
check :
32
- needs : authorize
53
+ needs : [configure]
33
54
34
55
name : Check for Vulnerabilities
35
56
runs-on : ubuntu-latest
36
57
37
58
steps :
38
59
- 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
40
61
41
- - uses : actions/checkout@v3
62
+ - uses : actions/checkout@v4
42
63
with :
43
- ref : ${{ github.event.pull_request.head.sha || github.ref }}
64
+ ref : ${{ github.event.pull_request.merge_commit_sha || github.ref }}
44
65
45
66
- uses : ./.github/actions/setup
46
67
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
48
81
49
- -
uses :
snyk/actions/php@b98d498629f1c368650224d6d212bf7dfa89e4bf # [email protected]
82
+ - run : snyk test --file=composer.lock --org=$SNYK_ORGANIZATION --project-name=$SNYK_PROJECT --remote-repo-url=$SNYK_REMOTE_REPO
50
83
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