codeql-analysis.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: "CodeQL"
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. # The branches below must be a subset of the branches above
  7. branches: [main]
  8. schedule:
  9. - cron: '0 16 * * 3'
  10. permissions:
  11. contents: read
  12. jobs:
  13. analyze:
  14. permissions:
  15. actions: read # for github/codeql-action/init to get workflow details
  16. contents: read # for actions/checkout to fetch code
  17. security-events: write # for github/codeql-action/autobuild to send a status report
  18. name: Analyze
  19. runs-on: ubuntu-latest
  20. strategy:
  21. fail-fast: false
  22. matrix:
  23. # Override automatic language detection by changing the below list
  24. # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
  25. language: ['javascript', 'python']
  26. # Learn more...
  27. # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
  28. steps:
  29. - name: Checkout repository
  30. uses: actions/checkout@v4
  31. with:
  32. # We must fetch at least the immediate parents so that if this is
  33. # a pull request then we can checkout the head.
  34. fetch-depth: 2
  35. # If this run was triggered by a pull request event, then checkout
  36. # the head of the pull request instead of the merge commit.
  37. - run: git checkout HEAD^2
  38. if: ${{ github.event_name == 'pull_request' }}
  39. # Initializes the CodeQL tools for scanning.
  40. - name: Initialize CodeQL
  41. uses: github/codeql-action/init@v2
  42. with:
  43. languages: ${{ matrix.language }}
  44. # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
  45. # If this step fails, then you should remove it and run the build manually (see below)
  46. - name: Autobuild
  47. uses: github/codeql-action/autobuild@v2
  48. # ℹ️ Command-line programs to run using the OS shell.
  49. # 📚 https://git.io/JvXDl
  50. # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
  51. # and modify them (or add more) to build your code if your project
  52. # uses a compiled language
  53. #- run: |
  54. # make bootstrap
  55. # make release
  56. - name: Perform CodeQL Analysis
  57. uses: github/codeql-action/analyze@v2