Skip to content

TPIP Check

TPIP Check #485

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:
if: github.repository == 'Open-CMSIS-Pack/vidx2pidx'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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/vidx2pidx \
--template ../scripts/template/${{ env.tpip_report }}.template \
> ../${{ env.tpip_report }}
working-directory: ./cmd
- name: Archive TPIP report
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: tpip-report
path: ./${{ env.tpip_report }}
- name: Print TPIP Report to summary
run: cat ${{ env.tpip_report }} >> $GITHUB_STEP_SUMMARY
- name: Check Licenses
run: |
go-licenses check . \
--ignore github.com/Open-CMSIS-Pack/vidx2pidx \
--disallowed_types=forbidden,restricted
working-directory: ./cmd
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@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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