Skip to main content

require-codeql-schedule

Rule catalog ID: R101

Targeted pattern scopeโ€‹

Workflows that run CodeQL analysis.

What this rule reportsโ€‹

This rule reports CodeQL workflows that do not define a schedule trigger.

Why this rule existsโ€‹

Scheduled CodeQL runs catch newly added queries, engine improvements, and baseline issues that may not be re-evaluated often enough through push-only activity.

โŒ Incorrectโ€‹

on:
push:
branches: [main]
pull_request:
branches: [main]

โœ… Correctโ€‹

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 0 * * 1"

Additional examplesโ€‹

This rule does not enforce a particular cron expression. It only requires that periodic re-analysis be configured.

ESLint flat config exampleโ€‹

import githubActions from "eslint-plugin-github-actions-2";

export default [githubActions.configs.codeScanning];

When not to use itโ€‹

Disable this rule if CodeQL scheduling is handled outside GitHub Actions or by organization-wide automation.

Further readingโ€‹