| name: "CodeQL" | |
| # Branches set to 2.x because this copy of the workflow lives on the 2.x | |
| # branch. For pull_request events, GitHub runs the workflow file from the | |
| # PR's BASE branch, so the branches filter here only needs to match events | |
| # that actually fire on 2.x â not the main/3.x copies, which carry their | |
| # own filters. | |
| on: | |
| push: | |
| branches: [2.x] | |
| pull_request: | |
| branches: [2.x] | |
| schedule: | |
| - cron: '0 19 * * 4' | |
| permissions: | |
| contents: read | |
| jobs: | |
| analyze: | |
| permissions: | |
| actions: read # for github/codeql-action/init to get workflow details | |
| contents: read # for actions/checkout to fetch code | |
| security-events: write # for codeql-action to upload SARIF results | |
| name: Analyze | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Override automatic language detection by changing the below list | |
| # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] | |
| language: ['javascript'] | |
| # Learn more... | |
| # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| # The legacy `git checkout HEAD^2` step that used to follow this | |
| # checkout has been removed: it presumes a merge commit with two | |
| # parents, but the repo's ruleset enforces linear history (squash | |
| # merges only), so PR heads are single-parent commits and HEAD^2 | |
| # is not a valid ref. Modern codeql-action handles PR head | |
| # checkout internally; the explicit step is unnecessary. | |
| # Initializes the CodeQL tools for scanning. | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 | |
| with: | |
| languages: ${{ matrix.language }} | |
| # Autobuild attempts to build any compiled languages (C/C++, C#, 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@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 | |
| # âšī¸ Command-line programs to run using the OS shell. | |
| # đ https://git.io/JvXDl | |
| # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines | |
| # and modify them (or add more) to build your code if your project | |
| # uses a compiled language | |
| #- run: | | |
| # make bootstrap | |
| # make release | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 |