Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add job to check oss licenses #2259

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 45 additions & 0 deletions .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: OSS Licenses

on:
push:
branches:
- main
pull_request:


jobs:
oss-licenses:
name: Third-Party Licenses
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2.4.0

- name: Install Go
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v2.2.0
with:
go-version: '1.19'
check-latest: true

- name: Go caches
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # v3.0.3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ github.job }}-${{ runner.os }}-go-

- name: Install go-licenses
run: go install github.com/google/[email protected]

- name: Check third-party licenses
run: |
go-licenses save ./... --save_path LICENSES/vendor/ --force
git_status="$(git status --porcelain)"
if [[ ${git_status} ]]; then
echo -e 'Third-party licenses are out-of-date. Please run `go-licenses save`\n'
echo "${git_status}"
exit 1
fi
202 changes: 202 additions & 0 deletions LICENSES/vendor/cloud.google.com/go/compute/metadata/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading