codeql.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. #
  7. # ******** NOTE ********
  8. # We have attempted to detect the languages in your repository. Please check
  9. # the `language` matrix defined below to confirm you have the correct set of
  10. # supported CodeQL languages.
  11. #
  12. name: "CodeQL Advanced"
  13. on:
  14. push:
  15. branches: ["main"]
  16. pull_request:
  17. branches: ["main"]
  18. schedule:
  19. - cron: "36 7 * * 4"
  20. jobs:
  21. analyze:
  22. name: Analyze (${{ matrix.language }})
  23. # Runner size impacts CodeQL analysis time. To learn more, please see:
  24. # - https://gh.io/recommended-hardware-resources-for-running-codeql
  25. # - https://gh.io/supported-runners-and-hardware-resources
  26. # - https://gh.io/using-larger-runners (GitHub.com only)
  27. # Consider using larger runners or machines with greater resources for possible analysis time improvements.
  28. runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
  29. permissions:
  30. # required for all workflows
  31. security-events: write
  32. # required to fetch internal or private CodeQL packs
  33. packages: read
  34. # only required for workflows in private repositories
  35. actions: read
  36. contents: read
  37. strategy:
  38. fail-fast: false
  39. matrix:
  40. include:
  41. - language: javascript-typescript
  42. build-mode: none
  43. - language: python
  44. build-mode: none
  45. - language: actions
  46. build-mode: none
  47. # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
  48. # Use `c-cpp` to analyze code written in C, C++ or both
  49. # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
  50. # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
  51. # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
  52. # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
  53. # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
  54. # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
  55. steps:
  56. - name: Checkout repository
  57. uses: actions/checkout@v4
  58. # Add any setup steps before running the `github/codeql-action/init` action.
  59. # This includes steps like installing compilers or runtimes (`actions/setup-node`
  60. # or others). This is typically only required for manual builds.
  61. # - name: Setup runtime (example)
  62. # uses: actions/setup-example@v1
  63. # Initializes the CodeQL tools for scanning.
  64. - name: Initialize CodeQL
  65. uses: github/codeql-action/init@v3
  66. with:
  67. languages: ${{ matrix.language }}
  68. config-file: .github/codeql-config.yml
  69. build-mode: ${{ matrix.build-mode }}
  70. # If you wish to specify custom queries, you can do so here or in a config file.
  71. # By default, queries listed here will override any specified in a config file.
  72. # Prefix the list here with "+" to use these queries and those in the config file.
  73. # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
  74. # queries: security-extended,security-and-quality
  75. # If the analyze step fails for one of the languages you are analyzing with
  76. # "We were unable to automatically build your code", modify the matrix above
  77. # to set the build mode to "manual" for that language. Then modify this step
  78. # to build your code.
  79. # ℹ️ Command-line programs to run using the OS shell.
  80. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
  81. - if: matrix.build-mode == 'manual'
  82. shell: bash
  83. run: |
  84. echo 'If you are using a "manual" build mode for one or more of the' \
  85. 'languages you are analyzing, replace this with the commands to build' \
  86. 'your code, for example:'
  87. echo ' make bootstrap'
  88. echo ' make release'
  89. exit 1
  90. - name: Perform CodeQL Analysis
  91. uses: github/codeql-action/analyze@v3
  92. with:
  93. category: "/language:${{matrix.language}}"