Skip to content

Commit 2be1867

Browse files
authored
ci: add license verification workflow (#23)
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
1 parent 7241ef5 commit 2be1867

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/actions/load-versions/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ outputs:
3434
addlicense:
3535
description: 'addlicense version'
3636
value: ${{ steps.versions.outputs.addlicense }}
37+
go_licenses:
38+
description: 'go-licenses version'
39+
value: ${{ steps.versions.outputs.go_licenses }}
3740
kind:
3841
description: 'Kind version'
3942
value: ${{ steps.versions.outputs.kind }}
@@ -75,6 +78,7 @@ runs:
7578
echo "golangci_lint=$(yq eval '.linting.golangci_lint' .versions.yaml)" >> $GITHUB_OUTPUT
7679
echo "yamllint=$(yq eval '.linting.yamllint' .versions.yaml)" >> $GITHUB_OUTPUT
7780
echo "addlicense=$(yq eval '.linting.addlicense' .versions.yaml)" >> $GITHUB_OUTPUT
81+
echo "go_licenses=$(yq eval '.linting.go_licenses' .versions.yaml)" >> $GITHUB_OUTPUT
7882
7983
# Security tools
8084
echo "grype=$(yq eval '.security_tools.grype' .versions.yaml)" >> $GITHUB_OUTPUT
@@ -97,6 +101,7 @@ runs:
97101
echo " golangci_lint: ${{ steps.versions.outputs.golangci_lint }}"
98102
echo " yamllint: ${{ steps.versions.outputs.yamllint }}"
99103
echo " addlicense: ${{ steps.versions.outputs.addlicense }}"
104+
echo " go_licenses: ${{ steps.versions.outputs.go_licenses }}"
100105
echo " grype: ${{ steps.versions.outputs.grype }}"
101106
echo " kubectl: ${{ steps.versions.outputs.kubectl }}"
102107
echo " kind: ${{ steps.versions.outputs.kind }}"

.github/workflows/verify-licenses.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ on:
2020
paths:
2121
- 'go.mod'
2222
- 'go.sum'
23+
- '.github/workflows/verify-licenses.yaml'
2324
pull_request:
2425
branches: [main]
2526
paths:
2627
- 'go.mod'
2728
- 'go.sum'
29+
- '.github/workflows/verify-licenses.yaml'
2830
workflow_dispatch: {}
2931

3032
permissions:
@@ -43,14 +45,18 @@ jobs:
4345
- name: Checkout Code
4446
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4547

48+
- name: Load versions
49+
id: versions
50+
uses: ./.github/actions/load-versions
51+
4652
- name: Setup Go
47-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
53+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
4854
with:
49-
go-version-file: go.mod
55+
go-version: ${{ steps.versions.outputs.go }}
5056
cache: true
5157

5258
- name: Install go-licenses
53-
run: go install github.com/google/go-licenses@latest
59+
run: go install github.com/google/go-licenses@${{ steps.versions.outputs.go_licenses }}
5460

5561
- name: Report licenses
5662
run: |

.versions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ linting:
2828
golangci_lint: 'v2.6.2'
2929
yamllint: '1.35.0'
3030
addlicense: 'v1.1.1'
31+
go_licenses: 'v1.6.0'
3132

3233
# Security Tools
3334
security_tools:

0 commit comments

Comments
 (0)