-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
40 lines (37 loc) · 1.48 KB
/
action.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
name: 'Sarif Quality Gate'
description: 'Counts the rule violations in a SARIF file and pass or fails based on the maximum violations threshold specified.'
branding:
icon: 'check-square'
color: 'green'
inputs:
sarif-file-path:
description: 'Path to the SARIF file to check, accepts any file format as long as the content is a valid SARIF'
required: true
max-errors:
description: 'Maximum number of errors allowed, unlimited if not provided'
required: false
max-warnings:
description: 'Maximum number of warnings allowed, unlimited if not provided'
required: false
max-notes:
description: 'Maximum number of notes allowed, unlimited if not provided'
required: false
runs:
using: "composite"
steps:
- run: if [[ -f ${{github.action_path}}/src/requirements.txt ]]; then pip install -r ${{github.action_path}}/src/requirements.txt >> /dev/null; fi
shell: bash
- run: |
echo "SARIF_FILE_PATH=${{ inputs.sarif-file-path }}" >> $GITHUB_ENV
echo "MAX_ERRORS=${{ inputs.max-errors }}" >> $GITHUB_ENV
echo "MAX_WARNINGS=${{ inputs.max-warnings }}" >> $GITHUB_ENV
echo "MAX_NOTES=${{ inputs.max-notes }}" >> $GITHUB_ENV
shell: bash
- id: quality-gate-check
run: python ${{github.action_path}}/src/action.py
shell: bash
outputs:
quality-gate-status:
description: >
The resulting Quality Gate Status value of PASSED or FAILED
value: ${{ steps.quality-gate-check.outputs.quality-gate-status }}