codeql-analysis.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # For most projects, this workflow file will not need changing; you simply need
  2. # to commit it to your repository.
  3. #
  4. # You may wish to alter this file to override the set of languages analyzed,
  5. # or to provide custom queries or build logic.
  6. name: "CodeQL"
  7. on:
  8. push:
  9. branches: [master]
  10. pull_request:
  11. # The branches below must be a subset of the branches above
  12. branches: [master]
  13. schedule:
  14. - cron: '0 18 * * 1'
  15. # Cancels all previous workflow runs for pull requests that have not completed.
  16. concurrency:
  17. # The concurrency group contains the workflow name and the branch name for
  18. # pull requests or the commit hash for any other events.
  19. group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
  20. cancel-in-progress: true
  21. permissions:
  22. contents: read # to fetch code (actions/checkout)
  23. jobs:
  24. analyze:
  25. permissions:
  26. contents: read # to fetch code (actions/checkout)
  27. security-events: write # (github/codeql-action/autobuild)
  28. name: Analyze
  29. runs-on: ubuntu-latest
  30. strategy:
  31. fail-fast: false
  32. matrix:
  33. # Override automatic language detection by changing the below list
  34. # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
  35. language: ['cpp', 'python']
  36. # Learn more...
  37. # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
  38. steps:
  39. - name: Checkout repository from github
  40. uses: actions/checkout@v3
  41. # Initializes the CodeQL tools for scanning.
  42. - name: Initialize CodeQL
  43. uses: github/codeql-action/init@v2
  44. with:
  45. languages: ${{ matrix.language }}
  46. # If you wish to specify custom queries, you can do so here or in a config file.
  47. # By default, queries listed here will override any specified in a config file.
  48. # Prefix the list here with "+" to use these queries and those in the config file.
  49. # queries: ./path/to/local/query, your-org/your-repo/queries@main
  50. # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
  51. # If this step fails, then you should remove it and run the build manually (see below)
  52. - name: Autobuild
  53. uses: github/codeql-action/autobuild@v2
  54. # ℹ️ Command-line programs to run using the OS shell.
  55. # 📚 https://git.io/JvXDl
  56. # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
  57. # and modify them (or add more) to build your code if your project
  58. # uses a compiled language
  59. #- run: |
  60. # make bootstrap
  61. # make release
  62. - name: Perform CodeQL Analysis
  63. uses: github/codeql-action/analyze@v2