Skip to content

GitLab CI/CD

include:
- remote: 'https://raw.githubusercontent.com/janitor-sh/gitlab-ci/main/.gitlab-ci.yml'
stages:
- lint
janitor:
stage: lint
variables:
JANITOR_COMMIT_MODE: auto
ValueEffect
defaultRun janitor with CLI default commit behavior.
autoRun janitor --auto-commit.
noneRun janitor --no-commit.

Invalid values fail the job with an explicit error.

The shared template runs for:

  • merge request pipelines ($CI_PIPELINE_SOURCE == "merge_request_event")
  • default branch pipelines ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH)

For maintainers of the template repository, self-tests can be enabled with:

variables:
JANITOR_TEMPLATE_SELF_TEST: "1"

This executes template jobs that verify JANITOR_COMMIT_MODE flag mapping (auto, none, default) and invalid-mode failure behavior.