Skip to content

Merge pull request #34 from triggermesh/fix-ci #130

Merge pull request #34 from triggermesh/fix-ci

Merge pull request #34 from triggermesh/fix-ci #130

Workflow file for this run

name: OSS Licenses
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
vendor:
name: Third-Party Licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Go caches
uses: actions/cache@v3
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/go-licenses@latest
- 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