Repository navigation
ci(codeql): analyse the Actions workflows and scan on any workflow change - #1309
Conversation
…ange codeql.yml initialised CodeQL with javascript-typescript only, so none of the ten workflow files were statically analysed, and its path filters named only codeql.yml itself, so a PR editing any other workflow never started the scan. Fan the analyze job out over a language matrix of javascript-typescript and actions (GA since 2025-04-22) with fail-fast: false, read the language into init and the analyze category from the matrix, and widen both paths: filters from .github/workflows/codeql.yml to .github/workflows/**. tests/codeql-contract.test.mjs pins the new shape: both languages must be in the matrix, init and analyze must read it, and the workflow glob must be in the filters. With the workflow change reverted the contract fails on three of its ten tests. Closes #1302 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
1e791e6
|
Security hardening
.github/workflows/codeql.ymlinitialised CodeQL withjavascript-typescriptonly, so none of the ten workflow files were statically analysed. Itspaths:filters also named onlycodeql.ymlitself, so a PR editingarchitecture-submission.yml(which runs onissues: [labeled]withcontents: writeand interpolates issue-derived values into action inputs) never started a scan.What changes
.github/workflows/codeql.ymljobs.analyzegainsstrategy.matrix.language: ['javascript-typescript', 'actions']withfail-fast: false;languages:andcategory:read${{ matrix.language }}; the job name becomesAnalyze ${{ matrix.language }}.paths:lists replace.github/workflows/codeql.ymlwith.github/workflows/**, so editing any workflow starts the scan. (.github/actions/does not exist here, so it is not listed.)permissions:,runs-on,timeout-minutes,build-mode: none,persist-credentials: falseand the schedule are unchanged.tests/codeql-contract.test.mjspins the new shape: both languages must be in the matrix withfail-fast: false,init/analyzemust read the matrix and name it in the category, and.github/workflows/**must be in the path filters. With the workflow change reverted, 3 of the contract's 10 tests fail.Notes for review
actionsrun can raise alerts to triage in the Security tab without blocking the queue. The check name changes fromAnalyze JavaScripttoAnalyze javascript-typescript/Analyze actions; nothing in the repository references the old name.tests/codeql-contract.test.mjs,ci-supply-chain,workflow-scriptsandci-concurrencysuites pass (56 tests);check:formatandcheck:spellingclean.Closes #1302