forked from chuckaude/hello-java
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (50 loc) · 2 KB
/
coverity-sarif-report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# example workflow for Coverity scans using the Synopsys Action
# https://github.com/marketplace/actions/synopsys-action
name: coverity-sarif-report
on:
push:
branches: [ main, master, develop, stage, release ]
workflow_dispatch:
jobs:
coverity:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: microsoft
cache: maven
- name: Coverity Full Scan
uses: synopsys-sig/[email protected]
with:
coverity_url: ${{ vars.COVERITY_URL }}
coverity_user: ${{ secrets.COV_USER }}
coverity_passphrase: ${{ secrets.COVERITY_PASSPHRASE }}
# coverity_project_name: ${{ github.event.repository.name }}
# coverity_stream_name: ${{ github.event.repository.name }}-${{ github.ref_name }}
# coverity_policy_view: 'Outstanding Issues'
coverity_local: true
- name: Coverity SARIF Report
env:
COVERITY_URL: ${{ vars.COVERITY_URL }}
COV_USER: ${{ secrets.COV_USER }}
COVERITY_PASSPHRASE: ${{ secrets.COVERITY_PASSPHRASE }}
run: |
COVERITY_TOOL_HOME=$HOME/.synopsys/bridge/tools/cov-analysis/*
IDIR=$(find ${{ github.workspace }}/.bridge -name idir)
$COVERITY_TOOL_HOME/bin/cov-format-errors --dir "$IDIR" --json-output-v10 issues.json
$COVERITY_TOOL_HOME/node/bin/node $COVERITY_TOOL_HOME/SARIF/cov-format-sarif-for-github.js --inputFile issues.json --outputFile results.sarif \
--githubUrl ${{ github.server_url }} --repoName ${{ github.repository }} --checkoutPath ${{ github.repository }} ${{ github.workspace }} ${{ github.sha }}
- name: Upload SARIF Report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
# - name: Save Logs
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: bridge-logs
# path: ${{ github.workspace }}/.bridge