diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..2434116 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,48 @@ +name: codeql + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '0 0 * * 0' + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + analyze: + name: analyze + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + steps: + - name: checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + fetch-depth: 2 + + - name: setup go + uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 + with: + go-version-file: "go.mod" + + - name: initialize codeql + uses: github/codeql-action/init@7434149006143a4d75b82a2f411ef15b03ccc2d7 #v4.31.10 + with: + languages: go + + - name: autobuild + uses: github/codeql-action/autobuild@7434149006143a4d75b82a2f411ef15b03ccc2d7 #v4.31.10 + + - name: perform codeql analysis + uses: github/codeql-action/analyze@7434149006143a4d75b82a2f411ef15b03ccc2d7 #v4.31.10 + with: + category: "/language:go"