Skip to content

Update README.rdoc

Update README.rdoc #5

name: FOSSA CLI Analysis
on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
workflow_dispatch:
jobs:
fossa:
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Run fossa
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
output="$(fossa list-targets --format=text)"
if [[ -n $output ]]
then
printf -- "%s\n" "$output"
fossa analyze
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/${{ github.repository_owner }}/properties/values \
-d '{"repository_names":[${{ github.repository }}],"properties":[{"property_name":"zeroFossaTargets","value":"null"}]}'
else
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/${{ github.repository_owner }}/properties/values \
-d '{"repository_names":[${{ github.repository }}],"properties":[{"property_name":"zeroFossaTargets","value":"True"}]}'
printf -- "Fossa did not find any analysis targets.\n"
fi