@@ -121,7 +121,7 @@ jobs:
121121 run : |
122122 make install
123123
124- - name : Check language tools used
124+ - name : Check language tools used and setup trivy config
125125 id : check_languages
126126 run : |
127127 if [ -f "pyproject.toml" ] && grep -q '\[tool.poetry\]' "pyproject.toml"; then
@@ -168,77 +168,68 @@ jobs:
168168 echo "****************"
169169 echo "uses_go=false" >> "$GITHUB_OUTPUT"
170170 fi
171+ # Create trivy config to include dev dependencies
171172 cat <<EOF >> trivy.yaml
172173 pkg:
173174 include-dev-deps: true
174175 EOF
175- - name : Check python licenses
176+ - name : Check licenses
176177 uses : aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
177178 if : ${{ steps.check_languages.outputs.uses_poetry == 'true' }}
178179 with :
179180 scan-type : " fs"
180- scan-ref : " poetry.lock"
181- severity : " CRITICAL,HIGH"
182- scanners : " license"
183- format : " table"
184- output : " license_scan_python.txt"
185- exit-code : " 1"
186- list-all-pkgs : " false"
187- trivy-config : trivy.yaml
188- - name : Check node licenses
189- uses : aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
190- if : ${{ steps.check_languages.outputs.uses_node == 'true' }}
191- with :
192- scan-type : " fs"
193- scan-ref : " package-lock.json"
194- severity : " CRITICAL,HIGH"
195- scanners : " license"
196- format : " table"
197- output : " license_scan_node.txt"
198- exit-code : " 1"
199- list-all-pkgs : " false"
200- trivy-config : trivy.yaml
201- - name : Check go licenses
202- uses : aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
203- if : ${{ steps.check_languages.outputs.uses_go == 'true' }}
204- with :
205- scan-type : " fs"
206- scan-ref : " src/go.mod"
181+ scan-ref : " ."
207182 severity : " CRITICAL,HIGH"
208183 scanners : " license"
209184 format : " table"
210- output : " license_scan_go.txt"
211- exit-code : " 1"
212- list-all-pkgs : " false"
213- trivy-config : trivy.yaml
214- - name : Check java licenses
215- uses : aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
216- if : ${{ steps.check_languages.outputs.uses_java == 'true' }}
217- with :
218- scan-type : " fs"
219- scan-ref : " pom.xml"
220- severity : " CRITICAL,HIGH"
221- scanners : " license"
222- format : " table"
223- output : " license_scan_java.txt"
185+ output : " license_scan.txt"
224186 exit-code : " 1"
225187 list-all-pkgs : " false"
226188 trivy-config : trivy.yaml
189+ version : " 0.68.2"
190+ # - name: Check node licenses
191+ # uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
192+ # if: ${{ steps.check_languages.outputs.uses_node == 'true' }}
193+ # with:
194+ # scan-type: "fs"
195+ # scan-ref: "package-lock.json"
196+ # severity: "CRITICAL,HIGH"
197+ # scanners: "license"
198+ # format: "table"
199+ # output: "license_scan_node.txt"
200+ # exit-code: "1"
201+ # list-all-pkgs: "false"
202+ # trivy-config: trivy.yaml
203+ # - name: Check go licenses
204+ # uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
205+ # if: ${{ steps.check_languages.outputs.uses_go == 'true' }}
206+ # with:
207+ # scan-type: "fs"
208+ # scan-ref: "src/go.mod"
209+ # severity: "CRITICAL,HIGH"
210+ # scanners: "license"
211+ # format: "table"
212+ # output: "license_scan_go.txt"
213+ # exit-code: "1"
214+ # list-all-pkgs: "false"
215+ # trivy-config: trivy.yaml
216+ # - name: Check java licenses
217+ # uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
218+ # if: ${{ steps.check_languages.outputs.uses_java == 'true' }}
219+ # with:
220+ # scan-type: "fs"
221+ # scan-ref: "pom.xml"
222+ # severity: "CRITICAL,HIGH"
223+ # scanners: "license"
224+ # format: "table"
225+ # output: "license_scan_java.txt"
226+ # exit-code: "1"
227+ # list-all-pkgs: "false"
228+ # trivy-config: trivy.yaml
227229 - name : Show license scan output
228230 if : always()
229231 run : |
230- if [ -f license_scan_python.txt ]; then
231- cat license_scan_python.txt
232- fi
233- if [ -f license_scan_node.txt ]; then
234- cat license_scan_node.txt
235- fi
236- if [ -f license_scan_go.txt ]; then
237- cat license_scan_go.txt
238- fi
239- if [ -f license_scan_java.txt ]; then
240- cat license_scan_java.txt
241- fi
232+ cat license_scan.txt
242233
243234 - name : Run code lint
244235 run : make lint
0 commit comments