|
|
@@ -1,49 +1,25 @@
|
|
|
name: Dependency License Checks
|
|
|
|
|
|
on:
|
|
|
- push:
|
|
|
- branches:
|
|
|
- - main
|
|
|
- - release-*
|
|
|
- paths:
|
|
|
- - "go.mod"
|
|
|
pull_request:
|
|
|
paths:
|
|
|
- "go.mod"
|
|
|
workflow_dispatch: {}
|
|
|
|
|
|
jobs:
|
|
|
- license-check:
|
|
|
+ fossa-scan:
|
|
|
runs-on: ubuntu-latest
|
|
|
steps:
|
|
|
- - name: Checkout
|
|
|
+ - name: "Checkout Code"
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
- - name: Setup Go
|
|
|
- uses: actions/setup-go@v3
|
|
|
+ - name: "Run FOSSA Scan"
|
|
|
+ uses: fossas/fossa-action@main
|
|
|
with:
|
|
|
- go-version-file: "go.mod"
|
|
|
+ api-key: ${{secrets.FOSSA_API_KEY}}
|
|
|
|
|
|
- - name: Find the Go Cache
|
|
|
- id: go
|
|
|
- run: |
|
|
|
- echo "::set-output name=build-cache::$(go env GOCACHE)"
|
|
|
- echo "::set-output name=mod-cache::$(go env GOMODCACHE)"
|
|
|
- - name: Cache the Go Build Cache
|
|
|
- uses: actions/cache@v3
|
|
|
+ - name: "Run FOSSA Test"
|
|
|
+ uses: fossas/fossa-action@main
|
|
|
with:
|
|
|
- path: ${{ steps.go.outputs.build-cache }}
|
|
|
- key: ${{ runner.os }}-build-check-diff-${{ github.sha }}-${{ hashFiles('**/go.sum') }}
|
|
|
- restore-keys: ${{ runner.os }}-build-check-diff-${{ github.sha }}-
|
|
|
-
|
|
|
- - name: Cache Go Dependencies
|
|
|
- uses: actions/cache@v3
|
|
|
- with:
|
|
|
- path: ${{ steps.go.outputs.mod-cache }}
|
|
|
- key: ${{ runner.os }}-pkg-${{ github.sha }}-${{ hashFiles('**/go.sum') }}
|
|
|
- restore-keys: ${{ runner.os }}-pkg-${{ github.sha }}-
|
|
|
-
|
|
|
- - name: License Checks
|
|
|
- run: |
|
|
|
- go install github.com/google/go-licenses@latest
|
|
|
- make license.check
|
|
|
+ api-key: ${{secrets.FOSSA_API_KEY}}
|
|
|
+ run-tests: true
|