name: FOSSA

on:
  push:
    branches: [main]

  pull_request:
    branches: [main]

jobs:
  fossa-license-scan:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2.4.0

      - uses: actions/setup-go@v2
        with:
          go-version: ^1.17

      - name: Add GOPATH
        run: |
          echo "GOPATH=$(go env GOPATH)"
          echo "GOPATH=$(go env GOPATH)" >>"$GITHUB_ENV"
          echo "$GOPATH/bin" >>"$GITHUB_PATH"
          
      - name: Run FOSSA scan and upload report
        uses: fossa-contrib/fossa-action@v1.2.0
        with:
          # FOSSA Push-Only API Token
          fossa-api-key: 304657e2357ba57b416b94e6b119131b
          github-token: ${{ github.token }}
