From 7e8850e90acd24ab9e928af58f33d750ba21aa53 Mon Sep 17 00:00:00 2001 From: Elaine Laguerta Date: Sat, 18 May 2024 23:45:44 -0700 Subject: [PATCH 1/7] specify team name for fossa analyze --- .github/workflows/fossa-caos.yml | 2 +- .github/workflows/fossa-default.yml | 2 +- .github/workflows/fossa-elixir.yml | 2 +- .github/workflows/fossa-gradle.yml | 2 +- .github/workflows/fossa-ruby-bundler.yml | 2 +- .github/workflows/fossa-scala.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fossa-caos.yml b/.github/workflows/fossa-caos.yml index 2ba8782..b328f0f 100644 --- a/.github/workflows/fossa-caos.yml +++ b/.github/workflows/fossa-caos.yml @@ -71,7 +71,7 @@ jobs: run: | export ANALYZE_OUT_FILE=${{ runner.temp }}/analyze_out.txt export ANALYZE_ERR_FILE=${{ runner.temp }}/analyze_err.txt - fossa analyze --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALYZE_ERR_FILE || true + fossa analyze --team='Service Accounts' --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALYZE_ERR_FILE || true if [[ $(grep "ERROR" $ANALYZE_ERR_FILE | wc -l) -gt 0 ]] then echo "::error::fossa analyze ran with errors." diff --git a/.github/workflows/fossa-default.yml b/.github/workflows/fossa-default.yml index 8e8bfab..744e348 100644 --- a/.github/workflows/fossa-default.yml +++ b/.github/workflows/fossa-default.yml @@ -67,7 +67,7 @@ jobs: run: | export ANALYZE_OUT_FILE=${{ runner.temp }}/analyze_out.txt export ANALYZE_ERR_FILE=${{ runner.temp }}/analyze_err.txt - fossa analyze --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALYZE_ERR_FILE || true + fossa analyze --team='Service Accounts' --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALYZE_ERR_FILE || true if [[ $(grep "ERROR" $ANALYZE_ERR_FILE | wc -l) -gt 0 ]] then echo "::error::fossa analyze ran with errors." diff --git a/.github/workflows/fossa-elixir.yml b/.github/workflows/fossa-elixir.yml index 943f3cb..3d255a6 100644 --- a/.github/workflows/fossa-elixir.yml +++ b/.github/workflows/fossa-elixir.yml @@ -71,7 +71,7 @@ jobs: run: | export ANALYZE_OUT_FILE=${{ runner.temp }}/analyze_out.txt export ANALZYE_ERR_FILE=${{ runner.temp }}/analyze_err.txt - fossa analyze --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALZYE_ERR_FILE || true + fossa analyze --team='Service Accounts' --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALZYE_ERR_FILE || true if [[ $(grep -i "error" $ANALYZE_ERR_FILE | wc -l) -gt 0 ]] then echo "::error::fossa analyze ran with errors." diff --git a/.github/workflows/fossa-gradle.yml b/.github/workflows/fossa-gradle.yml index 7da62c5..921f42d 100644 --- a/.github/workflows/fossa-gradle.yml +++ b/.github/workflows/fossa-gradle.yml @@ -90,7 +90,7 @@ jobs: run: | export ANALYZE_OUT_FILE=${{ runner.temp }}/analyze_out.txt export ANALZYE_ERR_FILE=${{ runner.temp }}/analyze_err.txt - fossa analyze --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALZYE_ERR_FILE || true + fossa analyze --team='Service Accounts' --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALZYE_ERR_FILE || true if [[ $(grep -i "error" $ANALYZE_ERR_FILE | wc -l) -gt 0 ]] then echo "::error::fossa analyze ran with errors." diff --git a/.github/workflows/fossa-ruby-bundler.yml b/.github/workflows/fossa-ruby-bundler.yml index 058d95a..a4a7bb6 100644 --- a/.github/workflows/fossa-ruby-bundler.yml +++ b/.github/workflows/fossa-ruby-bundler.yml @@ -70,7 +70,7 @@ jobs: run: | export ANALYZE_OUT_FILE=${{ runner.temp }}/analyze_out.txt export ANALZYE_ERR_FILE=${{ runner.temp }}/analyze_err.txt - fossa analyze --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALZYE_ERR_FILE || true + fossa analyze --team='Service Accounts' --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALZYE_ERR_FILE || true if [[ $(grep -i "error" $ANALYZE_ERR_FILE | wc -l) -gt 0 ]] then echo "::error::fossa analyze ran with errors." diff --git a/.github/workflows/fossa-scala.yml b/.github/workflows/fossa-scala.yml index 0d69344..121613e 100644 --- a/.github/workflows/fossa-scala.yml +++ b/.github/workflows/fossa-scala.yml @@ -72,7 +72,7 @@ jobs: run: | export ANALYZE_OUT_FILE=${{ runner.temp }}/analyze_out.txt export ANALZYE_ERR_FILE=${{ runner.temp }}/analyze_err.txt - fossa analyze --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALZYE_ERR_FILE || true + fossa analyze --team='Service Accounts' --policy='New Relic Public Github' 1>$ANALYZE_OUT_FILE 2>$ANALZYE_ERR_FILE || true if [[ $(grep -i "error" $ANALYZE_ERR_FILE | wc -l) -gt 0 ]] then echo "::error::fossa analyze ran with errors." From d3fe80f9d3b8d4f255cb7599a5d8666b11a85040 Mon Sep 17 00:00:00 2001 From: Elaine Laguerta Date: Sun, 19 May 2024 01:06:07 -0700 Subject: [PATCH 2/7] echo api key flag --- .github/workflows/fossa-default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fossa-default.yml b/.github/workflows/fossa-default.yml index 744e348..caa6490 100644 --- a/.github/workflows/fossa-default.yml +++ b/.github/workflows/fossa-default.yml @@ -13,7 +13,7 @@ jobs: HAS_FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY != '' }} steps: - id: check-fossa-api-key - run: echo "check=$HAS_FOSSA_API_KEY" >> "$GITHUB_OUTPUT" + run: echo "check=$HAS_FOSSA_API_KEY" >> "$GITHUB_OUTPUT" && echo $HAS_FOSSA_API_KEY outputs: HAS_FOSSA_API_KEY: ${{ steps.check-fossa-api-key.outputs.check }} From dd156903a83fb9e45ecab927d7da91c21ca15901 Mon Sep 17 00:00:00 2001 From: Elaine Laguerta Date: Sun, 19 May 2024 01:12:54 -0700 Subject: [PATCH 3/7] test: negate if --- .github/workflows/fossa-default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fossa-default.yml b/.github/workflows/fossa-default.yml index caa6490..8041965 100644 --- a/.github/workflows/fossa-default.yml +++ b/.github/workflows/fossa-default.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.HAS_FOSSA_API_KEY }} + if: ${{ !needs.check_env.HAS_FOSSA_API_KEY }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} From 2115334b82a6aa114420c5334f09e783be8daf28 Mon Sep 17 00:00:00 2001 From: Elaine Laguerta Date: Sun, 19 May 2024 01:15:06 -0700 Subject: [PATCH 4/7] test: remove echo of api flag --- .github/workflows/fossa-default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fossa-default.yml b/.github/workflows/fossa-default.yml index 8041965..616bdae 100644 --- a/.github/workflows/fossa-default.yml +++ b/.github/workflows/fossa-default.yml @@ -13,7 +13,7 @@ jobs: HAS_FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY != '' }} steps: - id: check-fossa-api-key - run: echo "check=$HAS_FOSSA_API_KEY" >> "$GITHUB_OUTPUT" && echo $HAS_FOSSA_API_KEY + run: echo "check=$HAS_FOSSA_API_KEY" >> "$GITHUB_OUTPUT" outputs: HAS_FOSSA_API_KEY: ${{ steps.check-fossa-api-key.outputs.check }} From d5a9043d233b3d9c87fea40560c541870bf022e4 Mon Sep 17 00:00:00 2001 From: Elaine Laguerta Date: Sun, 19 May 2024 01:18:29 -0700 Subject: [PATCH 5/7] fix: missing output key --- .github/workflows/fossa-caos.yml | 2 +- .github/workflows/fossa-default.yml | 2 +- .github/workflows/fossa-elixir.yml | 2 +- .github/workflows/fossa-gradle.yml | 2 +- .github/workflows/fossa-ruby-bundler.yml | 2 +- .github/workflows/fossa-scala.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fossa-caos.yml b/.github/workflows/fossa-caos.yml index b328f0f..925fdfb 100644 --- a/.github/workflows/fossa-caos.yml +++ b/.github/workflows/fossa-caos.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-default.yml b/.github/workflows/fossa-default.yml index 616bdae..515c174 100644 --- a/.github/workflows/fossa-default.yml +++ b/.github/workflows/fossa-default.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ !needs.check_env.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-elixir.yml b/.github/workflows/fossa-elixir.yml index 3d255a6..504e157 100644 --- a/.github/workflows/fossa-elixir.yml +++ b/.github/workflows/fossa-elixir.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-gradle.yml b/.github/workflows/fossa-gradle.yml index 921f42d..8a591e3 100644 --- a/.github/workflows/fossa-gradle.yml +++ b/.github/workflows/fossa-gradle.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-ruby-bundler.yml b/.github/workflows/fossa-ruby-bundler.yml index a4a7bb6..67a7f94 100644 --- a/.github/workflows/fossa-ruby-bundler.yml +++ b/.github/workflows/fossa-ruby-bundler.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-scala.yml b/.github/workflows/fossa-scala.yml index 121613e..0e1ff0e 100644 --- a/.github/workflows/fossa-scala.yml +++ b/.github/workflows/fossa-scala.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} From 0700e90aa3c8eaa5b5289eae0a7f2778a9ace515 Mon Sep 17 00:00:00 2001 From: Elaine Laguerta Date: Tue, 21 May 2024 11:37:13 -0700 Subject: [PATCH 6/7] fix: fossa if conditions checks string value of HAS_FOSSA_API_KEY --- .github/workflows/fossa-caos.yml | 2 +- .github/workflows/fossa-default.yml | 2 +- .github/workflows/fossa-elixir.yml | 2 +- .github/workflows/fossa-gradle.yml | 2 +- .github/workflows/fossa-ruby-bundler.yml | 2 +- .github/workflows/fossa-scala.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fossa-caos.yml b/.github/workflows/fossa-caos.yml index 925fdfb..a728eae 100644 --- a/.github/workflows/fossa-caos.yml +++ b/.github/workflows/fossa-caos.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-default.yml b/.github/workflows/fossa-default.yml index 515c174..3a14723 100644 --- a/.github/workflows/fossa-default.yml +++ b/.github/workflows/fossa-default.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-elixir.yml b/.github/workflows/fossa-elixir.yml index 504e157..6545d27 100644 --- a/.github/workflows/fossa-elixir.yml +++ b/.github/workflows/fossa-elixir.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-gradle.yml b/.github/workflows/fossa-gradle.yml index 8a591e3..1496296 100644 --- a/.github/workflows/fossa-gradle.yml +++ b/.github/workflows/fossa-gradle.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-ruby-bundler.yml b/.github/workflows/fossa-ruby-bundler.yml index 67a7f94..6162b89 100644 --- a/.github/workflows/fossa-ruby-bundler.yml +++ b/.github/workflows/fossa-ruby-bundler.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} diff --git a/.github/workflows/fossa-scala.yml b/.github/workflows/fossa-scala.yml index 0e1ff0e..1fa4985 100644 --- a/.github/workflows/fossa-scala.yml +++ b/.github/workflows/fossa-scala.yml @@ -19,7 +19,7 @@ jobs: fossa: needs: check_env - if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY }} + if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }} runs-on: ubuntu-latest env: FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}} From 676aea0f5287fc521eab13f0fe1a67a14e6a848c Mon Sep 17 00:00:00 2001 From: Elaine Laguerta Date: Tue, 21 May 2024 12:16:20 -0700 Subject: [PATCH 7/7] remove unsupported triggers. See https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#supported-event-triggers --- .github/workflows/fossa-caos.yml | 3 --- .github/workflows/fossa-default.yml | 3 --- .github/workflows/fossa-elixir.yml | 3 --- .github/workflows/fossa-gradle.yml | 3 --- .github/workflows/fossa-ruby-bundler.yml | 3 --- .github/workflows/fossa-scala.yml | 3 --- 6 files changed, 18 deletions(-) diff --git a/.github/workflows/fossa-caos.yml b/.github/workflows/fossa-caos.yml index a728eae..304dc17 100644 --- a/.github/workflows/fossa-caos.yml +++ b/.github/workflows/fossa-caos.yml @@ -1,10 +1,7 @@ name: FOSSA CLI Analysis on: - push: - branches: [ $default-branch ] pull_request: branches: [ $default-branch ] - workflow_dispatch: jobs: check_env: diff --git a/.github/workflows/fossa-default.yml b/.github/workflows/fossa-default.yml index 3a14723..9a36be8 100644 --- a/.github/workflows/fossa-default.yml +++ b/.github/workflows/fossa-default.yml @@ -1,10 +1,7 @@ name: FOSSA CLI Analysis on: - push: - branches: [ $default-branch ] pull_request: branches: [ $default-branch ] - workflow_dispatch: jobs: check_env: diff --git a/.github/workflows/fossa-elixir.yml b/.github/workflows/fossa-elixir.yml index 6545d27..3726689 100644 --- a/.github/workflows/fossa-elixir.yml +++ b/.github/workflows/fossa-elixir.yml @@ -1,10 +1,7 @@ name: FOSSA CLI Analysis on: - push: - branches: [ $default-branch ] pull_request: branches: [ $default-branch ] - workflow_dispatch: jobs: check_env: diff --git a/.github/workflows/fossa-gradle.yml b/.github/workflows/fossa-gradle.yml index 1496296..97cbdf0 100644 --- a/.github/workflows/fossa-gradle.yml +++ b/.github/workflows/fossa-gradle.yml @@ -1,10 +1,7 @@ name: FOSSA CLI Analysis on: - push: - branches: [ $default-branch ] pull_request: branches: [ $default-branch ] - workflow_dispatch: jobs: check_env: diff --git a/.github/workflows/fossa-ruby-bundler.yml b/.github/workflows/fossa-ruby-bundler.yml index 6162b89..cbf2b68 100644 --- a/.github/workflows/fossa-ruby-bundler.yml +++ b/.github/workflows/fossa-ruby-bundler.yml @@ -1,10 +1,7 @@ name: FOSSA CLI Analysis on: - push: - branches: [ $default-branch ] pull_request: branches: [ $default-branch ] - workflow_dispatch: jobs: check_env: diff --git a/.github/workflows/fossa-scala.yml b/.github/workflows/fossa-scala.yml index 1fa4985..3fa9250 100644 --- a/.github/workflows/fossa-scala.yml +++ b/.github/workflows/fossa-scala.yml @@ -1,10 +1,7 @@ name: FOSSA CLI Analysis - Scala on: - push: - branches: [ $default-branch ] pull_request: branches: [ $default-branch ] - workflow_dispatch: jobs: check_env: