From d01c5cedfecbc0c1c3724accde6dcce6969e895f Mon Sep 17 00:00:00 2001 From: Sourabh Mehta Date: Tue, 5 Sep 2023 14:37:27 +0200 Subject: [PATCH 1/9] Update TPIP report --- .github/workflows/tpip-check.yml | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tpip-check.yml b/.github/workflows/tpip-check.yml index 395de95..c896104 100644 --- a/.github/workflows/tpip-check.yml +++ b/.github/workflows/tpip-check.yml @@ -1,7 +1,6 @@ name: TPIP Check on: - # Trigger on pull request any Go package is changed. pull_request: paths: - ".github/workflows/tpip-check.yml" @@ -35,10 +34,10 @@ jobs: date +"%Y/%m/%d %T" >> ../../scripts/tpip.md working-directory: ./cmd/cbuild - - name: Save Changes + - name: Archive TPIP report uses: actions/upload-artifact@v3 with: - name: changes + name: tpip-report path: scripts/tpip.md - name: Print TPIP Report @@ -48,3 +47,30 @@ jobs: - name: Check Licenses run: go-licenses check . --ignore github.com/Open-CMSIS-Pack/cbuild --disallowed_types=forbidden,restricted working-directory: ./cmd/cbuild + + commit-changes: + needs: [ check-licenses ] + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_ADMIN_TOKEN }} + ref: ${{ github.event.pull_request.head.ref }} + + - name: Restore Changes + uses: actions/download-artifact@v3 + with: + name: tpip-report + + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + + - name: Commit Changes + uses: EndBug/add-and-commit@1bad3abcf0d6ec49a5857d124b0bfb52dc7bb081 + with: + message: "Update TPIP report [skip ci]" + add: | + scripts/tpip.md From 29c013b79ed1050eb80f6e6f843ab4b5adc7ffe5 Mon Sep 17 00:00:00 2001 From: Sourabh Mehta <73165318+soumeh01@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:13:02 +0200 Subject: [PATCH 2/9] Update tpip-check.yml --- .github/workflows/tpip-check.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tpip-check.yml b/.github/workflows/tpip-check.yml index c896104..9ba82a8 100644 --- a/.github/workflows/tpip-check.yml +++ b/.github/workflows/tpip-check.yml @@ -8,7 +8,10 @@ on: - "**/go.sum" - "scripts/template/**" workflow_dispatch: - + +env: + report_name: "tpip.md" + jobs: check-licenses: runs-on: ubuntu-latest @@ -30,18 +33,18 @@ jobs: - name: Generate TPIP Report run: | - go-licenses report . --ignore github.com/Open-CMSIS-Pack/cbuild --template ../../scripts/template/tpip-license.template > ../../scripts/tpip.md - date +"%Y/%m/%d %T" >> ../../scripts/tpip.md + go-licenses report . --ignore github.com/Open-CMSIS-Pack/cbuild --template ../../scripts/template/tpip-license.template > ../../scripts/${{ env.report_name }} + date +"%Y/%m/%d %T" >> ../../scripts/${{ env.report_name }} working-directory: ./cmd/cbuild - name: Archive TPIP report uses: actions/upload-artifact@v3 with: name: tpip-report - path: scripts/tpip.md + path: scripts/${{ env.report_name }} - name: Print TPIP Report - run: cat tpip.md >> $GITHUB_STEP_SUMMARY + run: cat ${{ env.report_name }} >> $GITHUB_STEP_SUMMARY working-directory: scripts - name: Check Licenses @@ -55,7 +58,6 @@ jobs: steps: - uses: actions/checkout@v3 with: - token: ${{ secrets.GH_ADMIN_TOKEN }} ref: ${{ github.event.pull_request.head.ref }} - name: Restore Changes @@ -69,8 +71,7 @@ jobs: id: extract_branch - name: Commit Changes - uses: EndBug/add-and-commit@1bad3abcf0d6ec49a5857d124b0bfb52dc7bb081 + uses: EndBug/add-and-commit@v9 with: message: "Update TPIP report [skip ci]" - add: | - scripts/tpip.md + add: scripts/${{ env.report_name }} From 198ab71eff828f6fe52f0b5fa868762cb46ac291 Mon Sep 17 00:00:00 2001 From: Sourabh Mehta Date: Wed, 6 Sep 2023 10:20:59 +0200 Subject: [PATCH 3/9] Cleanup --- .github/workflows/tpip-check.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tpip-check.yml b/.github/workflows/tpip-check.yml index 9ba82a8..0bcabf9 100644 --- a/.github/workflows/tpip-check.yml +++ b/.github/workflows/tpip-check.yml @@ -65,13 +65,16 @@ jobs: with: name: tpip-report - - name: Extract branch name - shell: bash - run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT - id: extract_branch - - name: Commit Changes - uses: EndBug/add-and-commit@v9 - with: - message: "Update TPIP report [skip ci]" - add: scripts/${{ env.report_name }} + shell: bash + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "Update documentation for ${MSG} ${GITHUB_REF_NAME}" + git push + # - name: Commit Changes + # uses: EndBug/add-and-commit@v9 + # with: + # message: "Update TPIP report [skip ci]" + # add: scripts/${{ env.report_name }} From 6ee5c1ab4aa33202a1c3330fa2e9612779623f9d Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 6 Sep 2023 08:26:35 +0000 Subject: [PATCH 4/9] Update documentation for 86/merge --- tpip.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tpip.md diff --git a/tpip.md b/tpip.md new file mode 100644 index 0000000..2a1b554 --- /dev/null +++ b/tpip.md @@ -0,0 +1,12 @@ +# Third Party Intellectual Property (TPIP) Report for [cbuild](https://github.com/Open-CMSIS-Pack/cbuild) + +| __Name__ | __Version__ | __Licence__ | +|----------|-------------|-------------| +| cbuild | Unknown | [Apache-2.0](Unknown) | +| github.com/sirupsen/logrus | v1.9.0 | [MIT](https://github.com/sirupsen/logrus/blob/v1.9.0/LICENSE) | +| github.com/spf13/cobra | v1.6.1 | [Apache-2.0](https://github.com/spf13/cobra/blob/v1.6.1/LICENSE.txt) | +| github.com/spf13/pflag | v1.0.5 | [BSD-3-Clause](https://github.com/spf13/pflag/blob/v1.0.5/LICENSE) | +| golang.org/x/sys/unix | v0.5.0 | [BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.5.0:LICENSE) | +| gopkg.in/yaml.v3 | v3.0.1 | [MIT](https://github.com/go-yaml/yaml/blob/v3.0.1/LICENSE) | + +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: 2023/09/06 08:26:19 From 57f7beb7d50ea42ea675a215fb306b49fbf6dc12 Mon Sep 17 00:00:00 2001 From: Sourabh Mehta Date: Wed, 6 Sep 2023 10:38:01 +0200 Subject: [PATCH 5/9] Addressed review comments --- .github/workflows/tpip-check.yml | 16 +++++----------- scripts/tpip.md => third_party_licenses.md | 0 tpip.md | 12 ------------ 3 files changed, 5 insertions(+), 23 deletions(-) rename scripts/tpip.md => third_party_licenses.md (100%) delete mode 100644 tpip.md diff --git a/.github/workflows/tpip-check.yml b/.github/workflows/tpip-check.yml index 0bcabf9..19dfc09 100644 --- a/.github/workflows/tpip-check.yml +++ b/.github/workflows/tpip-check.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: env: - report_name: "tpip.md" + report_name: "third_party_licenses.md" jobs: check-licenses: @@ -33,19 +33,18 @@ jobs: - name: Generate TPIP Report run: | - go-licenses report . --ignore github.com/Open-CMSIS-Pack/cbuild --template ../../scripts/template/tpip-license.template > ../../scripts/${{ env.report_name }} - date +"%Y/%m/%d %T" >> ../../scripts/${{ env.report_name }} + go-licenses report . --ignore github.com/Open-CMSIS-Pack/cbuild --template ../../scripts/template/tpip-license.template > ../../${{ env.report_name }} + date +"%Y/%m/%d %T" >> ../../${{ env.report_name }} working-directory: ./cmd/cbuild - name: Archive TPIP report uses: actions/upload-artifact@v3 with: name: tpip-report - path: scripts/${{ env.report_name }} + path: ./${{ env.report_name }} - name: Print TPIP Report run: cat ${{ env.report_name }} >> $GITHUB_STEP_SUMMARY - working-directory: scripts - name: Check Licenses run: go-licenses check . --ignore github.com/Open-CMSIS-Pack/cbuild --disallowed_types=forbidden,restricted @@ -71,10 +70,5 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com git add . - git commit -m "Update documentation for ${MSG} ${GITHUB_REF_NAME}" + git commit -m "Update TPIP report" git push - # - name: Commit Changes - # uses: EndBug/add-and-commit@v9 - # with: - # message: "Update TPIP report [skip ci]" - # add: scripts/${{ env.report_name }} diff --git a/scripts/tpip.md b/third_party_licenses.md similarity index 100% rename from scripts/tpip.md rename to third_party_licenses.md diff --git a/tpip.md b/tpip.md deleted file mode 100644 index 2a1b554..0000000 --- a/tpip.md +++ /dev/null @@ -1,12 +0,0 @@ -# Third Party Intellectual Property (TPIP) Report for [cbuild](https://github.com/Open-CMSIS-Pack/cbuild) - -| __Name__ | __Version__ | __Licence__ | -|----------|-------------|-------------| -| cbuild | Unknown | [Apache-2.0](Unknown) | -| github.com/sirupsen/logrus | v1.9.0 | [MIT](https://github.com/sirupsen/logrus/blob/v1.9.0/LICENSE) | -| github.com/spf13/cobra | v1.6.1 | [Apache-2.0](https://github.com/spf13/cobra/blob/v1.6.1/LICENSE.txt) | -| github.com/spf13/pflag | v1.0.5 | [BSD-3-Clause](https://github.com/spf13/pflag/blob/v1.0.5/LICENSE) | -| golang.org/x/sys/unix | v0.5.0 | [BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.5.0:LICENSE) | -| gopkg.in/yaml.v3 | v3.0.1 | [MIT](https://github.com/go-yaml/yaml/blob/v3.0.1/LICENSE) | - -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: 2023/09/06 08:26:19 From 21b6be6f45953aa97fdc5859c80fbd053b479f25 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 6 Sep 2023 08:39:34 +0000 Subject: [PATCH 6/9] Update TPIP report --- third_party_licenses.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/third_party_licenses.md b/third_party_licenses.md index e69de29..176a4ac 100644 --- a/third_party_licenses.md +++ b/third_party_licenses.md @@ -0,0 +1,12 @@ +# Third Party Intellectual Property (TPIP) Report for [cbuild](https://github.com/Open-CMSIS-Pack/cbuild) + +| __Name__ | __Version__ | __Licence__ | +|----------|-------------|-------------| +| cbuild | Unknown | [Apache-2.0](Unknown) | +| github.com/sirupsen/logrus | v1.9.0 | [MIT](https://github.com/sirupsen/logrus/blob/v1.9.0/LICENSE) | +| github.com/spf13/cobra | v1.6.1 | [Apache-2.0](https://github.com/spf13/cobra/blob/v1.6.1/LICENSE.txt) | +| github.com/spf13/pflag | v1.0.5 | [BSD-3-Clause](https://github.com/spf13/pflag/blob/v1.0.5/LICENSE) | +| golang.org/x/sys/unix | v0.5.0 | [BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.5.0:LICENSE) | +| gopkg.in/yaml.v3 | v3.0.1 | [MIT](https://github.com/go-yaml/yaml/blob/v3.0.1/LICENSE) | + +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: 2023/09/06 08:39:13 From 938a9852c3b68439c0f54c4d9c5f7c22d81a227a Mon Sep 17 00:00:00 2001 From: Sourabh Mehta Date: Wed, 6 Sep 2023 10:43:50 +0200 Subject: [PATCH 7/9] Add TPIP report to release --- .goreleaser.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index 1104c9f..5960f30 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -15,6 +15,7 @@ archives: - LICENSE - README.md - CHANGELOG.md + - third_party_licenses.md format_overrides: - goos: windows From 5d6c456764950c4b5d5577b13ca4429ae5cfd0e7 Mon Sep 17 00:00:00 2001 From: Sourabh Mehta Date: Thu, 7 Sep 2023 11:37:42 +0200 Subject: [PATCH 8/9] Renaming template file --- .github/workflows/tpip-check.yml | 10 +++++----- ...cense.template => third_party_licenses.md.template} | 0 2 files changed, 5 insertions(+), 5 deletions(-) rename scripts/template/{tpip-license.template => third_party_licenses.md.template} (100%) diff --git a/.github/workflows/tpip-check.yml b/.github/workflows/tpip-check.yml index 19dfc09..33b3213 100644 --- a/.github/workflows/tpip-check.yml +++ b/.github/workflows/tpip-check.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: env: - report_name: "third_party_licenses.md" + tpip_report: "third_party_licenses.md" jobs: check-licenses: @@ -33,18 +33,18 @@ jobs: - name: Generate TPIP Report run: | - go-licenses report . --ignore github.com/Open-CMSIS-Pack/cbuild --template ../../scripts/template/tpip-license.template > ../../${{ env.report_name }} - date +"%Y/%m/%d %T" >> ../../${{ env.report_name }} + go-licenses report . --ignore github.com/Open-CMSIS-Pack/cbuild --template ../../scripts/template/${{ env.tpip_report }}.template > ../../${{ env.tpip_report }} + date +"%Y/%m/%d %T" >> ../../${{ env.tpip_report }} working-directory: ./cmd/cbuild - name: Archive TPIP report uses: actions/upload-artifact@v3 with: name: tpip-report - path: ./${{ env.report_name }} + path: ./${{ env.tpip_report }} - name: Print TPIP Report - run: cat ${{ env.report_name }} >> $GITHUB_STEP_SUMMARY + 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 diff --git a/scripts/template/tpip-license.template b/scripts/template/third_party_licenses.md.template similarity index 100% rename from scripts/template/tpip-license.template rename to scripts/template/third_party_licenses.md.template From 7ba265b54a5aa60ce5d51fb06d67ed4c7a71df8c Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Sep 2023 10:44:24 +0000 Subject: [PATCH 9/9] Update TPIP report --- third_party_licenses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party_licenses.md b/third_party_licenses.md index 176a4ac..0dec2f4 100644 --- a/third_party_licenses.md +++ b/third_party_licenses.md @@ -9,4 +9,4 @@ | golang.org/x/sys/unix | v0.5.0 | [BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.5.0:LICENSE) | | gopkg.in/yaml.v3 | v3.0.1 | [MIT](https://github.com/go-yaml/yaml/blob/v3.0.1/LICENSE) | -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: 2023/09/06 08:39:13 +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: 2023/09/07 10:44:09