require-bitbucket-pipelines-max-time
Require max-time in Bitbucket Pipelines (globally or per step).
Targeted pattern scopeâ
This rule checks bitbucket-pipelines.yml (or bitbucket-pipelines.yaml) and validates timeout configuration via either:
options.max-time(global), orstep.max-time(per step)
What this rule reportsâ
This rule reports pipelines where no global options.max-time is configured and one or more steps also omit max-time.
Why this rule existsâ
Bitbucket Cloud documents max-time as the step timeout control (default 120 minutes). Explicit timeout configuration helps constrain runaway builds and CI minute consumption.
â Incorrectâ
pipelines:
default:
- step:
name: build
script:
- npm test
â Correctâ
options:
max-time: 30
pipelines:
default:
- step:
name: build
script:
- npm test
pipelines:
default:
- step:
name: build
max-time: 15
script:
- npm test
ESLint flat config exampleâ
import repoPlugin from "eslint-plugin-repo";
export default [
repoPlugin.configs.bitbucket,
{
plugins: { "repo-compliance": repoPlugin },
rules: {
"repo-compliance/require-bitbucket-pipelines-max-time": "error",
},
},
];
When not to use itâ
Disable this rule only if timeout policy is intentionally managed outside repository YAML and not expected to be declared in the pipeline file.
Rule catalog ID: R031