EkLine Docs Reviewer GitLab integration
Prerequisites
Section titled “Prerequisites”- EkLine Integration Token: Get it from Settings > Organization > Access in the EkLine Dashboard.
- GitLab Project: Admin access to configure CI/CD variables.
Quick start
Section titled “Quick start”Create or update the .gitlab-ci.yml file in your project root with this configuration:
stages: - ekline-pr-review
ekline-pr-review-job: stage: ekline-pr-review image: ghcr.io/ekline-io/ekline-ci-cd:v6 interruptible: true rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' script: - echo "Running EkLine" variables: INPUT_EK_TOKEN: $EK_TOKEN INPUT_GITLAB_TOKEN: $GITLAB_API_TOKEN INPUT_CONTENT_DIR: '<path_to_content_directory>' INPUT_REPORTER: 'gitlab-mr-discussion' INPUT_FILTER_MODE: 'added' # INPUT_IGNORE_RULE: "EK00001,EK00004" # Optional # INPUT_EXCLUDE_DIRECTORIES: "docs/archive" # Optional: one per line for multiple # INPUT_EXCLUDE_FILES: "README.md" # Optional: one per line for multipleReplace <path_to_content_directory> with the actual path to your content directory.
Use an interruptible pipeline
Section titled “Use an interruptible pipeline”The configuration above includes interruptible: true on the review job. This setting cancels a running EkLine review when you push a new commit to the same merge request. Without it, several review jobs can run at once on the same merge request. That wastes CI/CD minutes and can post duplicate or outdated comments.
Tip: Combine
interruptible: truewith the GitLab project setting Auto-cancel redundant pipelines (under Settings > CI/CD > General pipelines) so only the latest pipeline runs for each merge request.
Configure GitLab API token
Section titled “Configure GitLab API token”- In GitLab, go to Settings > Access tokens.
- Create a token with API access.
- Add the token to your project’s CI/CD > Variables as
GITLAB_API_TOKEN.
Configure EkLine integration token
Section titled “Configure EkLine integration token”- Copy your integration token from Settings > Organization > Access in the EkLine dashboard.
- Add the token to your project’s CI/CD > Variables as
EK_TOKEN.
Configure input reporter (optional)
Section titled “Configure input reporter (optional)”You can choose between two options for INPUT_REPORTER:
gitlab-mr-discussion(default): Reports results as merge request discussions.gitlab-mr-commit: Reports results on each commit in the merge request.
Configure input filter mode (optional)
Section titled “Configure input filter mode (optional)”The following options are available for INPUT_FILTER_MODE:
- added default: Filter results by added or modified lines.
diff_context: Filter results by diff context. That’s changed lines +-N lines, such as N=3.file: Filter results by added or modified file. EkLine reports results in those files, even outside the diff.nofilter: Don’t filter any results. Useful for posting results as comments as much as possible and checking other results in the console at the same time.
Ignoring specific optional rules
Section titled “Ignoring specific optional rules”To skip specific rules, set INPUT_IGNORE_RULE to a comma-separated list of rule IDs. For example, to skip EK00001 and EK00004:
INPUT_IGNORE_RULE: "EK00001,EK00004"Block merges until docs pass
Section titled “Block merges until docs pass”By default, EkLine posts its findings as merge request discussions without failing the job, so the merge request can still merge. To make the review a required gate:
-
Add
INPUT_REVIEWDOG_FLAGSto the job’svariables, so the job fails when EkLine reports an issue at error severity:variables:INPUT_REVIEWDOG_FLAGS: "-fail-level=error" -
In your GitLab project, open Settings > Merge requests. Under Merge checks, select Pipelines must succeed, then save your changes.
Exclude specific content directories and files
Section titled “Exclude specific content directories and files”Set INPUT_EXCLUDE_DIRECTORIES and INPUT_EXCLUDE_FILES to skip directories and files. Put one path on each line.
Example usages
Section titled “Example usages”Exclude directories and files:
variables: INPUT_CONTENT_DIR: 'docs' INPUT_EXCLUDE_DIRECTORIES: |- docs/archive docs/drafts INPUT_EXCLUDE_FILES: |- README.md docs/legacy.mdExclude files only:
variables: INPUT_EXCLUDE_FILES: |- README.md CONTRIBUTING.mdSave your changes and push the .gitlab-ci.yml file to your repository. EkLine then reviews your content directory and posts its feedback as merge request discussions.
Next steps
Section titled “Next steps”- Ignoring rules: handle false positives and suppress specific checks
- Framework support: configure EkLine for MDX, Astro, Docusaurus, and other frameworks
- Docs Agent: generate and update documentation from your codebase with AI
Built on Potluck Docs, our open source template.