| 1 |
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning |
| 2 |
name: CodeQL |
| 3 |
|
| 4 |
on: |
| 5 |
push: |
| 6 |
branches: [ master ] |
| 7 |
pull_request: |
| 8 |
branches: [ master ] |
| 9 |
paths-ignore: |
| 10 |
- '**/*.md' |
| 11 |
- '**/*.txt' |
| 12 |
- '**/*.json' |
| 13 |
workflow_dispatch: |
| 14 |
|
| 15 |
permissions: |
| 16 |
contents: read |
| 17 |
|
| 18 |
jobs: |
| 19 |
analyze: |
| 20 |
permissions: |
| 21 |
actions: read # for github/codeql-action/init to get workflow details |
| 22 |
contents: read # for actions/checkout to fetch code |
| 23 |
security-events: write # for github/codeql-action/autobuild to send a status report |
| 24 |
name: Analyze |
| 25 |
runs-on: ubuntu-latest |
| 26 |
|
| 27 |
strategy: |
| 28 |
fail-fast: false |
| 29 |
matrix: |
| 30 |
language: ['go'] |
| 31 |
|
| 32 |
steps: |
| 33 |
- name: Checkout repository |
| 34 |
uses: actions/checkout@v5 |
| 35 |
with: |
| 36 |
fetch-depth: 0 |
| 37 |
|
| 38 |
# Initializes the CodeQL tools for scanning. |
| 39 |
- name: Initialize CodeQL |
| 40 |
uses: github/codeql-action/init@v3 |
| 41 |
with: |
| 42 |
languages: ${{ matrix.language }} |
| 43 |
|
| 44 |
- name: Autobuild |
| 45 |
uses: github/codeql-action/autobuild@v3 |
| 46 |
|
| 47 |
- name: Perform CodeQL Analysis |
| 48 |
uses: github/codeql-action/analyze@v3 |