From 5b2c2a80dbf2060b5a13cc97d524fb0bbcf1bc1b Mon Sep 17 00:00:00 2001 From: Elaine Laguerta Date: Thu, 23 May 2024 11:03:43 -0700 Subject: [PATCH] fix: if no fossa targets, set fossaAnalyze to N/A right now projects with no targets are left with the default fossaAnalyze value of 'error' --- .github/workflows/fossa-default.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/fossa-default.yml b/.github/workflows/fossa-default.yml index 9a36be8..a5dd71d 100644 --- a/.github/workflows/fossa-default.yml +++ b/.github/workflows/fossa-default.yml @@ -58,6 +58,16 @@ jobs: -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/$ORG/properties/values \ -d '{"repository_names":["'"${REPO##*/}"'"],"properties":[{"property_name":"fossaHasTargets","value":"'"${{ steps.fossa-list-targets.outputs.HAS_FOSSA_TARGETS }}"'"}]}' + - name: Set fossaAnalyzeResult custom property to N/A + if: ${{ steps.fossa-list-targets.outputs.HAS_FOSSA_TARGETS == 'false'}} + run: | + curl -L \ + -X PATCH \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $CUSTOM_PROPS_PAT" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/orgs/$ORG/properties/values \ + -d '{"repository_names":["'"${REPO##*/}"'"],"properties":[{"property_name":"fossaAnalyzeResult","value":"'"N/A"'"}]}' - id: fossa-analyze name: Run fossa analyze if: ${{ steps.fossa-list-targets.outputs.HAS_FOSSA_TARGETS == 'True'}}