Skip to content

Commit 8d15ff3

Browse files
authored
Fix CI on forks by making the FOSSA step conditional on its secret (#174)
1 parent f550375 commit 8d15ff3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
- name: Add GOPATH to GITHUB_ENV
4141
run: echo "GOPATH=$(go env GOPATH)" >>"$GITHUB_ENV"
4242
- name: Scan and upload FOSSA data (Linux/Mac)
43-
if: github.ref == 'refs/heads/master' && matrix.platform != 'windows-latest'
43+
if: env.FOSSA_API_KEY != '' && github.ref == 'refs/heads/master' && matrix.platform != 'windows-latest'
4444
run: |
4545
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash
4646
fossa analyze
4747
env:
4848
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
4949
- name: Scan and upload FOSSA data (Windows)
50-
if: github.ref == 'refs/heads/master' && matrix.platform == 'windows-latest'
50+
if: env.FOSSA_API_KEY != '' && github.ref == 'refs/heads/master' && matrix.platform == 'windows-latest'
5151
run: |
5252
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/fossas/fossa-cli/master/install.ps1'))
5353
C:\ProgramData\fossa-cli\fossa.exe analyze

0 commit comments

Comments
 (0)