-
Notifications
You must be signed in to change notification settings - Fork 37
36 lines (30 loc) · 903 Bytes
/
rat.yaml
File metadata and controls
36 lines (30 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: RAT Check
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
rat:
name: Apache RAT Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Download Apache RAT
run: |
curl -L -O https://downloads.apache.org/creadur/apache-rat-0.17/apache-rat-0.17-bin.tar.gz
tar -xzf apache-rat-0.17-bin.tar.gz
- name: Run RAT
run: |
java -jar apache-rat-0.17/apache-rat-0.17.jar -d . -E .rat-excludes > rat-report.txt
cat rat-report.txt
# Fail if unapproved licenses are found
grep -qe '^\s*Unapproved:\s*0\s*A count of unapproved licenses.$' rat-report.txt && exit 0 || exit 1