codeql-analysis.yml 2.3 KB

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