| 1 | name: "CodeQL" |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [ "dev", "main" ] |
| 6 | pull_request: |
| 7 | # The branches below must be a subset of the branches above |
| 8 | branches: [ "dev", "main" ] |
| 9 | schedule: |
| 10 | - cron: '30 9 * * 3' |
| 11 | |
| 12 | jobs: |
| 13 | analyze: |
| 14 | name: Analyze |
| 15 | runs-on: 'ubuntu-latest' |
| 16 | timeout-minutes: 60 |
| 17 | permissions: |
| 18 | actions: read |
| 19 | contents: read |
| 20 | security-events: write |
| 21 | |
| 22 | strategy: |
| 23 | fail-fast: false |
| 24 | matrix: |
| 25 | language: [ 'go' ] |
| 26 | |
| 27 | steps: |
| 28 | - name: Checkout repository |
| 29 | uses: actions/checkout@v3 |
| 30 | |
| 31 | - name: Initialize CodeQL |
| 32 | uses: github/codeql-action/init@v2 |
| 33 | with: |
| 34 | languages: ${{ matrix.language }} |
| 35 | # If you wish to specify custom queries, you can do so here or in a config file. |
| 36 | # By default, queries listed here will override any specified in a config file. |
| 37 | # Prefix the list here with "+" to use these queries and those in the config file. |
| 38 | |
| 39 | # 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 |
| 40 | # queries: security-extended,security-and-quality |
| 41 | |
| 42 | |
| 43 | # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). |
| 44 | # If this step fails, then you should remove it and run the build manually (see below) |
| 45 | - name: Autobuild |
| 46 | uses: github/codeql-action/autobuild@v2 |
| 47 | |
| 48 | # âšī¸ Command-line programs to run using the OS shell. |
| 49 | # đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
| 50 | |
| 51 | # If the Autobuild fails above, remove it and uncomment the following three lines. |
| 52 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. |
| 53 | |
| 54 | # - run: | |
| 55 | # echo "Run, Build Application using script" |
| 56 | # ./location_of_script_within_repo/buildscript.sh |
| 57 | |
| 58 | - name: Perform CodeQL Analysis |
| 59 | uses: github/codeql-action/analyze@v2 |
| 60 | with: |
| 61 | category: "/language:${{matrix.language}}" |