ci: Tune license checks on fork repositories (#20700)

This commit is contained in:
Mykola Mokhnach
2024-10-27 08:32:20 +01:00
committed by GitHub
parent 7860c05285
commit fdcf234e51

View File

@@ -13,12 +13,6 @@ jobs:
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
@@ -29,5 +23,9 @@ jobs:
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
if [ -n "$FOSSA_API_KEY" ]; then
fossa analyze
fossa test
else
echo "License checks did not run. FOSSA_API_KEY is not defined for this fork."
fi