2
0

codeql.yml 3.8 KB

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