| name: "CodeQL" | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| # The branches below must be a subset of the branches above | |
| branches: [ "main" ] | |
| permissions: # added using https://github.com/step-security/secure-workflows | |
| contents: read | |
| jobs: | |
| CodeQL-Build: | |
| name: Analyze | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| # Initializes the CodeQL tools for scanning. | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@515828d97454b8354517688ddc5b48402b723750 # v2.1.38 | |
| with: | |
| languages: go | |
| # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). | |
| # If this step fails, then you should remove it and run the build manually (see below) | |
| - name: Autobuild | |
| uses: github/codeql-action/autobuild@515828d97454b8354517688ddc5b48402b723750 # v2.1.38 | |
| # âšī¸ Command-line programs to run using the OS shell. | |
| # đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | |
| # If the Autobuild fails above, remove it and uncomment the following three lines. | |
| # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | |
| # - run: | | |
| # echo "Run, Build Application using script" | |
| # ./location_of_script_within_repo/buildscript.sh | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@515828d97454b8354517688ddc5b48402b723750 # v2.1.38 | |
| with: | |
| category: "/language:go" | |
| - name: Check with osv-detector | |
| uses: G-Rath/check-with-osv-detector@0e8c0f954d8618a3a4671eca1918b30b2d085af3 # v0.2.0 |