codacy-analysis.yml 2.4 KB

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