Add Synopsys Security Scan Workflow #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is parttly based on https://github.com/marketplace/actions/synopsys-intelligent-security-scan. | |
name: Coverity | |
on: | |
push: | |
branches: [ main, stage, 'releases/**' ] | |
pull_request: | |
branches: [ main, stage, 'releases/**' ] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Coverity: | |
runs-on: ubuntu-latest | |
env: | |
COV_URL: ${{ secrets.SYNOPSYS_ACCESS_URL }} | |
COV_USER: ${{ secrets.SYNOPSYS_ACCESS_EMAIL }} | |
COVERITY_PASSPHRASE: ${{ secrets.SYNOPSYS_ACCESS_TOKEN }} | |
CSA: cov-analysis-linux64-2020.12 | |
COVERITY_PROJECT: franziska-wegner/egoa | |
BLDCMD: mvn -B clean package -DskipTests | |
CHECKERS: --webapp-security | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Coverity Download | |
run: | | |
curl -fLsS --user $COV_USER:$COVERITY_PASSPHRASE $COV_URL/downloadFile.htm?fn=$CSA.tar.gz | tar -C /tmp -xzf - | |
curl -fLsS --user $COV_USER:$COVERITY_PASSPHRASE -o /tmp/$CSA/bin/license.dat $COV_URL/downloadFile.htm?fn=license.dat | |
/tmp/$CSA/bin/cov-configure --java | |
- name: Coverity Full Scan | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
export PATH=$PATH:/tmp/$CSA/bin | |
set -x | |
cov-build --dir idir --fs-capture-search $GITHUB_WORKSPACE $BLDCMD | |
cov-analyze --dir idir --ticker-mode none --strip-path $GITHUB_WORKSPACE $CHECKERS | |
cov-commit-defects --dir idir --ticker-mode none --url $COV_URL --stream $COVERITY_PROJECT-${GITHUB_REF##*/} --scm git \ | |
--description $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID --target $RUNNER_OS --version $GITHUB_SHA | |
- name: Coverity Quality Gate | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
curl -fLsS --user $COV_USER:$COVERITY_PASSPHRASE $COV_URL/api/viewContents/issues/v1/OWASP%20Web%20Top%2010?projectId=$COVERITY_PROJECT > results.json | |
if [ $(cat results.json | jq .viewContentsV1.totalRows) -ne 0 ]; then cat results.json | jq .viewContentsV1.rows; exit 1; fi | |
- id: changeset | |
name: Get Pull Request Changeset | |
uses: jitterbit/get-changed-files@v1 | |
if: ${{ github.event_name == 'pull_request' }} | |
- name: Coverity Incremental Scan | |
if: ${{ github.event_name == 'pull_request' && steps.changeset.outputs.added_modified != '' }} | |
run: | | |
export PATH=$PATH:/tmp/$CSA/bin | |
set -x | |
cov-run-desktop --dir idir --url $COV_URL --stream $COVERITY_PROJECT-$GITHUB_BASE_REF --build $BLDCMD | |
cov-run-desktop --dir idir --url $COV_URL --stream $COVERITY_PROJECT-$GITHUB_BASE_REF --present-in-reference false \ | |
--ignore-uncapturable-inputs true --exit1-if-defects true ${{ steps.changeset.outputs.added_modified }} |