Skip to content

Commit 02ab307

Browse files
DaanHooglandDaan Hoogland
andauthored
GitHub Action for RAT check (#173)
Co-authored-by: Daan Hoogland <[email protected]>
1 parent f4a900a commit 02ab307

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/rat.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: RAT Check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
rat:
13+
name: Apache RAT Check
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Java
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: temurin
24+
java-version: 17
25+
26+
- name: Download Apache RAT
27+
run: |
28+
curl -L -O https://downloads.apache.org/creadur/apache-rat-0.16.1/apache-rat-0.16.1-bin.tar.gz
29+
tar -xzf apache-rat-0.16.1-bin.tar.gz
30+
31+
- name: Run RAT
32+
run: |
33+
java -jar apache-rat-0.16.1/apache-rat-0.16.1.jar -d . -E .rat-excludes > rat-report.txt
34+
cat rat-report.txt
35+
# Fail if unapproved licenses are found
36+
grep -qe '^0 Unknown Licenses' rat-report.txt && exit 0 || exit 1

.rat-excludes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHANGES.md
2+
go.sum
3+
rat-report.txt
4+
apache-rat-0.16.1
5+
snapcraft.yaml
6+
vendor
7+
.rat-excludes

0 commit comments

Comments
 (0)