-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.84 KB
/
license_check.yml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Check licenses
on:
workflow_dispatch:
push:
branches-ignore:
- master
- version-*
- dependabot**
paths-ignore:
- README.md
jobs:
prebuild-job:
name: Prebuild Job
uses: th2-net/.github/.github/workflows/compound-prebuild-java-dev-workflow.yml@main
with:
runsOn: 'ubuntu-20.04'
check_licenses:
runs-on: 'ubuntu-20.04'
needs: [prebuild-job]
steps:
- name: checkout actions
uses: actions/checkout@v4
- name: Install jq env
run: |
sudo apt-get update
sudo apt-get install -y jq
- name: Download script
run: |
wget -q -O check_licenses.sh https://raw.githubusercontent.com/th2-net/.github/th2-1836-json-files-update/license-compliance/check_licenses.sh
chmod +x ./check_licenses.sh
- name: Run check_licenses script
id: run_script
run: |
./check_licenses.sh java
line_count=$(wc -l < ./licenses_check/failed_licenses.csv)
if [[ $line_count -gt 1 ]]; then
echo "FAILED due to unknown/failed licenses found"
exit 1
else
echo "PASSED: licenses check successfull"
exit 0
fi
- name: Get repository name
if: ${{ !cancelled() }}
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $NF}')" >> $GITHUB_OUTPUT
id: meta
- name: Uploading results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: licenses_check-${{ steps.meta.outputs.REPOSITORY_NAME }}-${{ needs.prebuild-job.outputs.version }}
path: ./licenses_check/
# - name: Set workflow status
# run: echo "::set-output name=status::Failure"
# if: steps.set_status.outputs.result == 'FAILED due to unknown licenses found'
# continue-on-error: false