Skip to content

Commit

Permalink
Auto auto tpip check
Browse files Browse the repository at this point in the history
  • Loading branch information
soumeh01 committed Sep 4, 2023
1 parent ee33d3f commit e59872b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/tpip-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: TPIP Check

on:
# Trigger on pull request any Go package is changed.
pull_request:
paths:
- "**/go.mod"
- "**/go.sum"
workflow_dispatch:

jobs:
check-licenses:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true

- name: tidy
run: go mod tidy

- name: install go-licenses
run: go install github.com/google/go-licenses@latest

- name: Generate TPIP Report
run: |
go-licenses report . --ignore github.com/Open-CMSIS-Pack/cbuild --template ../../scripts/templates/tpip-license.template > ../../scripts/tpip.md
date +"%Y/%m/%d %T" >> ../../scripts/tpip.md
working-directory: ./cmd/cbuild

- name: Save Changes
uses: actions/upload-artifact@v3
with:
name: changes
path: scripts/tpip.md

- name: Print TPIP Report
run: cat tpip.md >> $GITHUB_STEP_SUMMARY
working-directory: scripts

- name: Check Licenses
run: go-licenses check . --ignore github.com/Open-CMSIS-Pack/cbuild --disallowed_types=forbidden,restricted
working-directory: ./cmd/cbuild
9 changes: 9 additions & 0 deletions scripts/template/tpip-license.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Third Party Intellectual Property (TPIP) Report for [cbuild](https://github.com/Open-CMSIS-Pack/cbuild)

| __Name__ | __Version__ | __Licence__ |
|----------|-------------|-------------|
{{- range . }}
| {{ .Name }} | {{ .Version }} | [{{ .LicenseName }}]({{ .LicenseURL }}) |
{{- end }}

Report generated and repository checked for [forbidden](https://github.com/google/licenseclassifier/blob/842c0d70d7027215932deb13801890992c9ba364/license_type.go#L323) and [restricted](https://github.com/google/licenseclassifier/blob/842c0d70d7027215932deb13801890992c9ba364/license_type.go#L176) licenses on:
Empty file added scripts/tpip.md
Empty file.

0 comments on commit e59872b

Please sign in to comment.