Skip to content

Commit ea7f355

Browse files
reeshika-hclaude
andcommitted
ci: run SCA scan on runner with JDK 17 and Android SDK
The snyk/actions/gradle container has no Android SDK and its Gradle 8.5 init script fails, so snyk.json was never written. Set up JDK and the Android SDK on the runner and run the Snyk CLI there instead. Refs DX-20927 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c697362 commit ea7f355

1 file changed

Lines changed: 28 additions & 6 deletions

File tree

‎.github/workflows/sca-scan.yml‎

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,34 @@ jobs:
1010
pull-requests: write
1111
steps:
1212
- uses: actions/checkout@master
13-
- name: Run Snyk to check for vulnerabilities
14-
uses: snyk/actions/gradle@master
13+
14+
- name: Set up JDK 17
15+
uses: actions/setup-java@v4
16+
with:
17+
distribution: 'temurin'
18+
java-version: '17'
19+
cache: 'gradle'
20+
21+
- name: Set up Android SDK
22+
uses: android-actions/setup-android@v3
23+
with:
24+
packages: 'platform-tools platforms;android-34 build-tools;34.0.0'
25+
26+
- name: Setup local.properties
27+
run: |
28+
cat << EOF >> local.properties
29+
sdk.dir=$ANDROID_HOME
30+
EOF
31+
32+
- name: Set up Snyk
33+
uses: snyk/actions/setup@master
34+
with:
35+
snyk-version: latest
36+
37+
- name: Run Snyk
1538
env:
1639
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
17-
with:
18-
args: --fail-on=all --all-sub-projects
19-
json: true
40+
run: snyk test --fail-on=all --all-sub-projects --json > snyk.json
2041
continue-on-error: true
21-
- uses: contentstack/sca-policy@main
42+
43+
- uses: contentstack/sca-policy@main

0 commit comments

Comments
 (0)