Skip to content

Commit c9525f2

Browse files
Create veracode-analysis.yml
1 parent 9221168 commit c9525f2

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow will initiate a Veracode Static Analysis Pipeline scan, return a results.json and convert to SARIF for upload as a code scanning alert
2+
3+
name: Veracode Static Analysis Pipeline Scan
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ master ]
10+
pull_request:
11+
branches: [ master ]
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a job to build and submit pipeline scan, you will need to customize the build process accordingly and make sure the artifact you build is used as the file input to the pipeline scan file parameter
16+
build-and-pipeline-scan:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
steps:
20+
21+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it and copies all sources into ZIP file for submitting for analysis. Replace this section with your applications build steps
22+
- uses: actions/checkout@v2
23+
with:
24+
repository: ''
25+
26+
- uses: papeloto/action-zip@v1
27+
with:
28+
files: /
29+
recursive: true
30+
dest: veracode-pipeline-scan-results-to-sarif.zip
31+
32+
- uses: actions/upload-artifact@v1
33+
with:
34+
name: my-artifact
35+
path: veracode-pipeline-scan-results-to-sarif.zip
36+
37+
# download the Veracode Static Analysis Pipeline scan jar
38+
- uses: wei/curl@master
39+
with:
40+
args: -O https://downloads.veracode.com/securityscan/pipeline-scan-LATEST.zip
41+
- run: unzip -o pipeline-scan-LATEST.zip
42+
43+
- uses: actions/setup-java@v1
44+
with:
45+
java-version: 1.8
46+
- run: java -jar pipeline-scan.jar --veracode_api_id "${{secrets.VERACODE_API_ID}}" --veracode_api_key "${{secrets.VERACODE_API_KEY}}" --fail_on_severity="Very High, High" --file veracode-pipeline-scan-results-to-sarif.zip
47+
continue-on-error: true
48+
- uses: actions/upload-artifact@v1
49+
with:
50+
name: ScanResults
51+
path: results.json
52+
- name: Convert pipeline scan output to SARIF format
53+
id: convert
54+
uses: veracode/veracode-pipeline-scan-results-to-sarif@master
55+
with:
56+
pipeline-results-json: results.json
57+
- uses: github/codeql-action/upload-sarif@v1
58+
with:
59+
# Path to SARIF file relative to the root of the repository
60+
sarif_file: veracode-results.sarif

0 commit comments

Comments
 (0)