ci: Only run FOSSA checks on the main repo (#20696)

This commit is contained in:
Mykola Mokhnach
2024-10-25 22:25:18 +02:00
committed by GitHub
parent f548edc0d5
commit 4dc98932db
2 changed files with 10 additions and 443 deletions

View File

@@ -10,17 +10,24 @@ jobs:
fossa-check:
name: Run FOSSA Analysis
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
steps:
- name: Ignore forks
run: |
if [ -z "$FOSSA_API_KEY" ]; then
echo "FOSSA_API_KEY is empty. Is the job running in a forked repository?"
exit 0
fi
- uses: actions/checkout@v4
with:
ref: master
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Install fossa-cli
run: ./scripts/install-fossa.sh -d
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
- name: Run FOSSA analysis
run: |
fossa analyze
fossa test
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}