codeql.yml 4.4 KB

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