-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (90 loc) · 3.19 KB
/
tpip-check.yml
File metadata and controls
108 lines (90 loc) · 3.19 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: TPIP Check
on:
pull_request:
paths:
- ".github/workflows/tpip-check.yml"
- "**/go.mod"
- "**/go.sum"
- "scripts/template/**"
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
env:
tpip_report: "third_party_licenses.md"
permissions:
contents: read
jobs:
check-licenses:
if: github.repository == 'Open-CMSIS-Pack/cbuild2cmake'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Harden Runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: go.mod
check-latest: true
- name: Go tidy
run: go mod tidy
- name: Install go-licenses
run: go install github.com/google/go-licenses@5348b744d0983d85713295ea08a20cca1654a45e # v1.6.0
- name: Generate TPIP Report
run: |
go-licenses report . \
--ignore github.com/Open-CMSIS-Pack/cbuild2cmake \
--template ../../scripts/template/${{ env.tpip_report }}.template \
> ../../${{ env.tpip_report }}
working-directory: ./cmd/cbuild2cmake
- name: Archive TPIP report
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: tpip-report
path: ./${{ env.tpip_report }}
- name: Print TPIP Report report to summary
run: cat ${{ env.tpip_report }} >> $GITHUB_STEP_SUMMARY
- name: Check Licenses
run: |
go-licenses check . \
--ignore github.com/Open-CMSIS-Pack/cbuild2cmake \
--disallowed_types=forbidden,restricted
working-directory: ./cmd/cbuild2cmake
commit-changes:
if: (github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch')
needs: [ check-licenses ]
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
pull-requests: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Restore Changes
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: tpip-report
- name: Create pull request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.GRASCI_WORKFLOW_UPDATE }}
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