# CodeQL: static analysis for the two languages this repo actually ships. # # The reason to have it is not the Scorecard point. The gateway parses untrusted input from a browser # (a scope query, a merge patch) and hands back objects it has projected; the client merges a stream # into a document a user is editing. That is where taint tracking earns its runtime. name: codeql on: push: branches: [main] pull_request: branches: [main] schedule: # The schedule matters: it re-runs the current queries against unchanged code, which is how a # newly-published query finds an old bug that no push would have re-examined. - cron: "40 4 * * 2" permissions: read-all jobs: analyze: name: analyze (${{ matrix.language }}) runs-on: ubuntu-latest timeout-minutes: 20 permissions: security-events: write # the whole point: write the findings to code scanning packages: read contents: read strategy: fail-fast: false matrix: include: - language: go build-mode: autobuild - language: javascript-typescript build-mode: none # interpreted; CodeQL reads the source directly steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false # go.work ties gateway/ and gateway/kube/ together and autobuild honours it, so both modules are # analysed. kube being a separate module must not make it the one nobody scans. - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 if: matrix.language == 'go' with: go-version-file: gateway/go.mod cache: false - name: initialize codeql uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} # security-extended, not the default suite: here a false positive costs a few minutes and a # missed leak costs a Secret. queries: security-extended - name: analyze uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: category: /language:${{ matrix.language }}