require-gitlab-ci-config-file
Require .gitlab-ci.yml for GitLab CI automation.
Targeted pattern scopeâ
This rule checks the repository root for .gitlab-ci.yml.
What this rule reportsâ
This rule reports repositories that enable GitLab-oriented presets without a GitLab CI pipeline definition.
Why this rule existsâ
GitLab CI features depend on a root pipeline configuration file.
Without .gitlab-ci.yml, later GitLab-specific rules about stages, workflow
rules, or security scanning cannot describe an actual pipeline baseline.
â Incorrectâ
// Repository files
// .
// âââ README.md
// âââ package.json
// âââ src/
//
// Missing: .gitlab-ci.yml
â Correctâ
// Repository files
// .
// âââ .gitlab-ci.yml
// âââ README.md
// âââ package.json
ESLint flat config exampleâ
import repoPlugin from "eslint-plugin-repo";
export default [
repoPlugin.configs.gitlab,
{
plugins: { "repo-compliance": repoPlugin },
rules: {
"repo-compliance/require-gitlab-ci-config-file": "error",
},
},
];
When not to use itâ
Disable this rule only if the repository does not use GitLab CI at all.
Rule catalog ID: R012