Skip to content

Commit 2a964cc

Browse files
committed
CI(Dependency): Dependency Check and Submission
1 parent e436e19 commit 2a964cc

6 files changed

Lines changed: 111 additions & 8 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Dependency Check"
2+
3+
on:
4+
push:
5+
branches: [ 'develop', 'master', 'release_**', 'feat/state_root_sync' ]
6+
pull_request:
7+
branches: [ 'develop', "release_**" , 'feat/state_root_sync' ]
8+
schedule:
9+
- cron: '25 6 * * *'
10+
workflow_dispatch:
11+
12+
jobs:
13+
dependency-check:
14+
name: Dependency Check
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Cache ODC data
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.dependency-check/data
25+
key: ${{ runner.os }}-odc-data-${{ hashFiles('**/build.gradle') }}
26+
restore-keys: |
27+
${{ runner.os }}-odc-data-
28+
29+
- name: Set up JDK 8
30+
uses: actions/setup-java@v3
31+
with:
32+
java-version: '8'
33+
distribution: 'temurin'
34+
35+
- name: Gradlew build
36+
run: ./gradlew --no-daemon -S -Dorg.gradle.dependency.verification=off -Dorg.gradle.warning.mode=none build -x test
37+
38+
- name: Dependency Check
39+
uses: dependency-check/Dependency-Check_Action@1.1.0
40+
env:
41+
# actions/setup-java@v1 changes JAVA_HOME, so it needs to be reset to match the depcheck image
42+
JAVA_HOME: /opt/jdk
43+
with:
44+
project: 'java-tron'
45+
path: '.'
46+
format: 'HTML'
47+
out: 'reports'
48+
args: >
49+
--failOnCVSS 7
50+
--enableRetired
51+
--suppression ${{github.workspace}}/suppression.xml
52+
- name: Generate timestamp
53+
run: echo "BUILD_TIMESTAMP=$(date -u +"%Y%m%d-%H%M%S")" >> $GITHUB_ENV
54+
- name: Get Repository Name
55+
run: echo "REPO_NAME=$(echo '${{ github.repository }}' | cut -d'/' -f2)" >> $GITHUB_ENV
56+
- name: Upload report
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: dependency-check-${{ env.REPO_NAME }}-${{ env.BUILD_TIMESTAMP }}
61+
path: ${{github.workspace}}/reports
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Dependency Submission
2+
3+
on:
4+
push:
5+
branches: [ 'develop', 'master', 'release_**', 'feat/state_root_sync' ]
6+
pull_request:
7+
branches: [ 'develop', "release_**" , 'feat/state_root_sync' ]
8+
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
dependency-submission:
16+
runs-on: ubuntu-24.04-arm
17+
18+
steps:
19+
- name: Checkout sources
20+
uses: actions/checkout@v4
21+
- name: Setup Java
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: 'temurin'
25+
java-version: 17
26+
- name: Setup Gradle
27+
uses: gradle/actions/setup-gradle@v4
28+
- name: Generate and submit dependency graph
29+
uses: gradle/actions/dependency-submission@v4

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ println "Building for architecture: ${archInfo.name}, Java version: ${archInfo.j
4444

4545

4646
subprojects {
47+
apply plugin: "java"
4748
apply plugin: "jacoco"
4849
apply plugin: "maven-publish"
4950

common/build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
plugins {
2-
id 'java'
3-
}
4-
51
version '1.0.0'
62

3+
74
dependencies {
85
api group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.18.3' // https://github.com/FasterXML/jackson-databind/issues/3627
96
api "com.cedarsoftware:java-util:3.2.0"

crypto/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
plugins {
2-
id 'java'
3-
}
4-
51
version '1.0.0'
62

73
repositories {

suppression.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
4+
5+
<suppress>
6+
<notes><![CDATA[file name: java-tron-1.0.0.zip: grpc-netty-1.75.0.jar]]></notes>
7+
<sha1>6edfe492eef2a4e41e247f984d7e1f062fe2f47d</sha1>
8+
<cve>CVE-2019-20444</cve>
9+
<cve>CVE-2019-20445</cve>
10+
<cve>CVE-2025-55163</cve>
11+
<cve>CVE-2015-2156</cve>
12+
<cve>CVE-2019-16869</cve>
13+
<cve>CVE-2021-37136</cve>
14+
<cve>CVE-2021-37137</cve>
15+
<cve>CVE-2022-41881</cve>
16+
<cve>CVE-2023-44487</cve>
17+
</suppress>
18+
19+
</suppressions>

0 commit comments

Comments
 (0)