Skip to content

Commit 1ec17bf

Browse files
authored
ci: FINOS license compliance workflow (#271) (#272)
## Summary - Adds `license.yml` workflow enforcing FINOS license category compliance on every push/PR to main - Removes `gradle-suppressions.xml` (OWASP dependency-check no longer used; CVE scanning handled by Grype) ## Changes ### Gradle (`com.github.jk1:gradle-license-report`) - `checkLicense` task applied to all subprojects, scans `runtimeClasspath` only - `gradle-allowed-licenses.json` — FINOS Category A (permitted) + Category B (permitted with CONTRIBUTING notice); Category X omitted → build fails on violation - `gradle-license-overrides.txt` — PSV overrides for two deps with malformed POM license declarations (`org.jspecify:jspecify`, `com.nimbusds:oauth2-oidc-sdk`), both confirmed Apache-2.0 - `InventoryHtmlReportRenderer` generates a grouped HTML report uploaded as a CI artifact ### npm (`license-checker-rseidelsohn`) - Added as pinned devDependency in frontend `package.json` - `license-check` npm script checks production deps only (`--production --excludePrivatePackages`) - All 13 production deps pass: MIT / BSD-3-Clause / Apache-2.0 / ISC ## Test plan - [x] `./gradlew checkLicense -PskipFrontend` passes clean across all three subprojects locally - [x] `npm run license-check` passes locally (13 deps, all FINOS Category A) - [x] CI `license.yml` workflow passes on this PR closes #271
2 parents d3639c8 + 6ba34e3 commit 1ec17bf

7 files changed

Lines changed: 934 additions & 22 deletions

File tree

.github/workflows/license.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: License Compliance
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: ["main"]
9+
pull_request:
10+
branches: ["main"]
11+
12+
jobs:
13+
license-gradle:
14+
name: Gradle (license)
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
21+
22+
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5
23+
with:
24+
distribution: temurin
25+
java-version: 25
26+
cache: gradle
27+
28+
- name: Check licenses
29+
run: ./gradlew checkLicense -PskipFrontend
30+
31+
- name: Upload license report
32+
if: always()
33+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # ratchet:actions/upload-artifact@v7
34+
with:
35+
name: gradle-license-report
36+
path: "**/build/reports/dependency-license/"
37+
retention-days: 30
38+
39+
license-npm:
40+
name: npm (license)
41+
runs-on: ubuntu-latest
42+
permissions:
43+
contents: read
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
47+
48+
- name: Install dependencies
49+
run: npm ci --prefer-offline
50+
working-directory: git-proxy-java-dashboard/frontend
51+
52+
- name: Check licenses
53+
run: npm run license-check
54+
working-directory: git-proxy-java-dashboard/frontend

build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ plugins {
1111
id 'com.diffplug.spotless' version '8.4.0' apply false
1212
id 'org.cyclonedx.bom' version '3.2.4'
1313
id 'com.github.node-gradle.node' version '7.1.0' apply false
14+
id 'com.github.jk1.dependency-license-report' version '2.9' apply false
1415
}
1516

1617
ext {
@@ -105,6 +106,20 @@ tasks.register('installGitHooks') {
105106
subprojects {
106107
apply plugin: 'com.diffplug.spotless'
107108
apply plugin: 'jacoco-report-aggregation'
109+
apply plugin: 'com.github.jk1.dependency-license-report'
110+
111+
licenseReport {
112+
allowedLicensesFile = rootProject.file('gradle-allowed-licenses.json')
113+
configurations = ['runtimeClasspath']
114+
excludeOwnGroup = true
115+
excludeBoms = true
116+
// These deps have malformed POM license declarations (null name or quoted MIME-style string)
117+
// but are confirmed Apache-2.0. Overrides in gradle-license-overrides.txt fix the HTML report.
118+
excludes = ['org.jspecify:jspecify', 'com.nimbusds:oauth2-oidc-sdk']
119+
renderers = [new com.github.jk1.license.render.InventoryHtmlReportRenderer(
120+
'index.html', 'git-proxy-java', rootProject.file('gradle-license-overrides.txt')),
121+
new com.github.jk1.license.render.JsonReportRenderer('licenses.json')]
122+
}
108123

109124
spotless {
110125
java {

0 commit comments

Comments
 (0)