|
| 1 | +# This workflow checks out code, performs a Codacy security scan |
| 2 | +# and integrates the results with the |
| 3 | +# GitHub Advanced Security code scanning feature. For more information on |
| 4 | +# the Codacy security scan action usage and parameters, see |
| 5 | +# https://github.com/codacy/codacy-analysis-cli-action. |
| 6 | +# For more information on Codacy Analysis CLI in general, see |
| 7 | +# https://github.com/codacy/codacy-analysis-cli. |
| 8 | + |
| 9 | +name: Codacy Security Scan |
| 10 | + |
| 11 | +on: |
| 12 | +push: |
| 13 | +branches: [ master ] |
| 14 | +pull_request: |
| 15 | +# The branches below must be a subset of the branches above |
| 16 | +branches: [ master ] |
| 17 | +schedule: |
| 18 | + - cron: '27 22 * * 4' |
| 19 | + |
| 20 | +jobs: |
| 21 | +codacy-security-scan: |
| 22 | +name: Codacy Security Scan |
| 23 | +runs-on: ubuntu-latest |
| 24 | +steps: |
| 25 | +# Checkout the repository to the GitHub Actions runner |
| 26 | + - name: Checkout code |
| 27 | +uses: actions/checkout@v2 |
| 28 | + |
| 29 | +# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis |
| 30 | + - name: Run Codacy Analysis CLI |
| 31 | +uses: codacy/codacy-analysis-cli-action@1.1.0 |
| 32 | +with: |
| 33 | +# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository |
| 34 | +# You can also omit the token and run the tools that support default configurations |
| 35 | +project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} |
| 36 | +verbose: true |
| 37 | +output: results.sarif |
| 38 | +format: sarif |
| 39 | +# Adjust severity of non-security issues |
| 40 | +gh-code-scanning-compat: true |
| 41 | +# Force 0 exit code to allow SARIF file generation |
| 42 | +# This will handover control about PR rejection to the GitHub side |
| 43 | +max-allowed-issues: 2147483647 |
| 44 | + |
| 45 | +# Upload the SARIF file generated in the previous step |
| 46 | + - name: Upload SARIF results file |
| 47 | +uses: github/codeql-action/upload-sarif@v1 |
| 48 | +with: |
| 49 | +sarif_file: results.sarif |
0 commit comments