codeql-analysis.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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, release-branch/* ]
  16. pull_request:
  17. # The branches below must be a subset of the branches above
  18. branches: [ main ]
  19. merge_group:
  20. branches: [ main ]
  21. schedule:
  22. - cron: '31 14 * * 5'
  23. concurrency:
  24. group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  25. cancel-in-progress: true
  26. jobs:
  27. analyze:
  28. name: Analyze
  29. runs-on: ubuntu-latest
  30. permissions:
  31. actions: read
  32. contents: read
  33. security-events: write
  34. strategy:
  35. fail-fast: false
  36. matrix:
  37. language: [ 'go' ]
  38. # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
  39. # Learn more:
  40. # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
  41. steps:
  42. - name: Checkout repository
  43. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  44. # Install a more recent Go that understands modern go.mod content.
  45. - name: Install Go
  46. uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
  47. with:
  48. go-version-file: go.mod
  49. # Initializes the CodeQL tools for scanning.
  50. - name: Initialize CodeQL
  51. uses: github/codeql-action/init@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5
  52. with:
  53. languages: ${{ matrix.language }}
  54. # If you wish to specify custom queries, you can do so here or in a config file.
  55. # By default, queries listed here will override any specified in a config file.
  56. # Prefix the list here with "+" to use these queries and those in the config file.
  57. # queries: ./path/to/local/query, your-org/your-repo/queries@main
  58. # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
  59. # If this step fails, then you should remove it and run the build manually (see below)
  60. - name: Autobuild
  61. uses: github/codeql-action/autobuild@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5
  62. # ℹ️ Command-line programs to run using the OS shell.
  63. # 📚 https://git.io/JvXDl
  64. # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
  65. # and modify them (or add more) to build your code if your project
  66. # uses a compiled language
  67. #- run: |
  68. # make bootstrap
  69. # make release
  70. - name: Perform CodeQL Analysis
  71. uses: github/codeql-action/analyze@c793b717bc78562f491db7b0e93a3a178b099162 # v4.32.5