Skip to content

Commit

Permalink
save fossa step outputs to file
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertdeng123 committed Apr 11, 2023
1 parent 8e3c899 commit c5d31c3
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
shell: bash
run: echo "This action should only run on getsentry repos" && exit 1

- name: 'Pick a FOSSA API key'
- name: 'Pick a FOSSA API key and install FOSSA cli'
id: set_key
shell: bash
env:
Expand All @@ -27,27 +27,29 @@ runs:
# here in this file and gives us at least basic pass/fail.
#
# See also: https://docs.fossa.com/docs/api-reference#api-tokens
FALLBACK="9fc50c40b136c68873ad05aec573cf3e"
echo "key=${PREFERRED:-$FALLBACK}" >> "$GITHUB_OUTPUT"
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
- name: 'Checkout Code'
uses: actions/checkout@v2

- name: 'Run FOSSA Scan'
id: analyze
continue-on-error: true
uses: fossas/fossa-action@5913e730490ebf75ae47b59687b7e590289eed92
with:
api-key: ${{ steps.set_key.outputs.key }}
env:
FOSSA_API_KEY: ${{ steps.set_key.outputs.key }}
shell: bash
run: |
exec &> >(tee -a "analyze_logs.txt")
fossa analyze
- if: steps.analyze.outcome == 'failure'
name: 'Send error to Sentry on FOSSA scan failure'
shell: bash
env:
SENTRY_URL: https://self-hosted.getsentry.net/
SENTRY_ORG: self-hosted
SENTRY_PROJECT: test
SENTRY_DSN: https://0bc733fd07014f73a703d97ab5452ae2@self-hosted.getsentry.net/4
run: |
curl -sL https://sentry.io/get-cli/ | sh
Expand All @@ -59,10 +61,12 @@ runs:
- if: steps.analyze.outcome == 'success'
name: 'Run FOSSA Test'
id: test
uses: fossas/fossa-action@5913e730490ebf75ae47b59687b7e590289eed92
with:
api-key: ${{ steps.set_key.outputs.key }}
run-tests: true
env:
FOSSA_API_KEY: ${{ steps.set_key.outputs.key }}
shell: bash
run: |
exec &> >(tee -a "test_logs.txt")
fossa test
- if: github.repository_owner == 'getsentry' && failure()
name: 'Handle errors'
Expand Down

0 comments on commit c5d31c3

Please sign in to comment.