Skip to content

TPIP Check

TPIP Check #328

Workflow file for this run

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:
# Avoid running this on forks
if: github.repository == 'Open-CMSIS-Pack/cbuild'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
checks: write
pull-requests: write
actions: write
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.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@latest
- name: Generate TPIP Report
run: |
go-licenses report . --ignore github.com/Open-CMSIS-Pack/cbuild --template ../../scripts/template/${{ env.tpip_report }}.template > ../../${{ env.tpip_report }}
working-directory: ./cmd/cbuild
- name: Archive TPIP report
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: tpip-report
path: ./${{ env.tpip_report }}
- name: Print TPIP Report
run: cat ${{ env.tpip_report }} >> $GITHUB_STEP_SUMMARY
- name: Check Licenses
run: go-licenses check . --ignore github.com/Open-CMSIS-Pack/cbuild --disallowed_types=forbidden,restricted
working-directory: ./cmd/cbuild
commit-changes:
# Running this job only on specific event
# in order to have workaround for issue
# related to deletion of GH checks/status data
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
if: (github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch')
needs: [ check-licenses ]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Restore Changes
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tpip-report
- name: Create Pull Request
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
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