require-github-code-scanning-workflow
Require a GitHub Actions code scanning workflow file.
Targeted pattern scopeâ
This rule checks .github/workflows/ for the presence of at least one file matching
recognised GitHub code scanning workflow naming conventions: codeql.yml,
codeql.yaml, codeql-analysis.yml, codeql-analysis.yaml,
code-scanning.yml, code-scanning.yaml, security-analysis.yml, or
security-analysis.yaml.
What this rule reportsâ
This rule reports when none of the recognised GitHub code scanning workflow
filenames is present in .github/workflows/.
Why this rule existsâ
GitHub code scanning workflows such as CodeQL catch security vulnerabilities and code quality issues before they reach production. A dedicated workflow makes that automation visible in the repository and easier to audit. Without it, repositories often rely on ad-hoc or undocumented scanning.
â Incorrectâ
// No code scanning workflow found
.github/
workflows/
ci.yml
release.yml
â Correctâ
.github/
workflows/
codeql.yml â a recognised code scanning workflow name
ci.yml
release.yml
ESLint flat config exampleâ
import repoPlugin from "eslint-plugin-repo";
export default [
repoPlugin.configs.github,
{
plugins: { "repo-compliance": repoPlugin },
rules: {
"repo-compliance/require-github-code-scanning-workflow": "warn",
},
},
];
When not to use itâ
Disable this rule if your repository:
- Uses a different naming convention for its code scanning workflow.
- Relies on organisation-level SAST tooling that runs outside this repository.
- Is intentionally excluded from automated static analysis (e.g., documentation-only repos).
Rule catalog ID: R043