-
Notifications
You must be signed in to change notification settings - Fork 19
90 lines (76 loc) · 2.74 KB
/
tpip-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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: TPIP Check
on:
pull_request:
paths:
- ".github/workflows/tpip-check.yml"
- "**/go.mod"
- "**/go.sum"
- "tools/eventlist/template/**"
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
env:
tpip_report: "third_party_licenses.md"
jobs:
check-licenses:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
cache-dependency-path: tools/eventlist/go.sum
go-version-file: tools/eventlist/go.mod
check-latest: true
- name: Go tidy
run: go mod tidy
working-directory: ./tools/eventlist
- name: Install go-licenses
run: go install github.com/google/go-licenses@latest
- name: Generate TPIP Report
run: |
cp LICENSE ./tools/eventlist
- name: Generate TPIP Report
run: |
go-licenses report . ../make --ignore github.com/ARM-software/CMSIS-View/tree/main/tools/eventlist --template ../../template/${{ env.tpip_report }}.template > ../../${{ env.tpip_report }}
working-directory: ./tools/eventlist/cmd/eventlist
- name: Archive TPIP report
uses: actions/upload-artifact@v3
with:
name: tpip-report
path: ./tools/eventlist/${{ env.tpip_report }}
- name: Print TPIP Report
run: cat ${{ env.tpip_report }} >> $GITHUB_STEP_SUMMARY
working-directory: ./tools/eventlist
- name: Check Licenses
run: go-licenses check . --ignore github.com/ARM-software/CMSIS-View/tree/main/tools/eventlist --disallowed_types=forbidden,restricted
working-directory: ./tools/eventlist/cmd/eventlist
commit-changes:
# Running this job only on specific event
# in order to have workaround for issue
# related to deletion of GH checks/status data
if: (github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch')
needs: [ check-licenses ]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Restore Changes
uses: actions/download-artifact@v3
with:
name: tpip-report
path: ./tools/eventlist
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update TPIP report
title: ':robot: [TPIP] Automated report updates'
body: |
Third party IP report updates
branch: update-tpip
delete-branch: true
labels: TPIP
reviewers: soumeh01