Skip to content

Commit 4482d34

Browse files
committed
ci: Update Workflows
1 parent a5d172a commit 4482d34

File tree

2 files changed

+49
-12
lines changed

2 files changed

+49
-12
lines changed

.github/workflows/semgrep.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ jobs:
3838

3939
steps:
4040
- if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group'
41-
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.
41+
run: exit 0
4242

43-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4444
with:
45-
ref: ${{ github.event.pull_request.head.sha || github.ref }}
45+
ref: ${{ github.event.pull_request.merge_commit_sha || github.ref }}
4646

4747
- run: semgrep ci
4848
env:
49-
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
49+
SEMGREP_APP_TOKEN: ${{ secrets.DX_SDKS_SEMGREP_TOKEN }}

.github/workflows/snyk.yml

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Snyk
22

33
on:
44
merge_group:
5-
workflow_dispatch:
65
pull_request_target:
76
types:
87
- opened
@@ -16,6 +15,12 @@ on:
1615
permissions:
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+
1924
concurrency:
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 # [email protected]
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

Comments
 (0)