A scheduled pipeline should skip when there are no changes, and only specific users can manually run production jobs.
IntermediateScenarioGitLab CI
Answer
Situation read → Control triggers and actors.
What I'd do →
- Combine
rules:changeswith$CI_PIPELINE_SOURCE == "schedule"where needed. - Mark
productionas a protected environment with allowed deployers and optional approvals. - Restrict who can run manual jobs by protecting the branch and environment.
Why → Roles are enforced by the platform, not by job code.
Interview tip → Protected environments support multi-approver rules.
More on GitLab CI
How does GitLab CI/CD work at a high level?BeginnerWhat is a GitLab Runner and what executors exist?IntermediateWhat are the types of runners (shared, group, project) and tags?IntermediateHow do `rules:` work and how do they replace `only/except`?IntermediateWhat are workflow rules and how do they prevent duplicate pipelines?AdvancedHow do artifacts and cache differ in GitLab CI?Intermediate