Skip to content

EkLine Docs Reviewer GitHub Actions integration

Set up EkLine Docs Reviewer as a GitHub Action to automatically review documentation in pull requests. Enforce style guides and catch errors before merging.

Before you begin, confirm you have the following:

  1. EkLine Token: Get it from the Dashboard.
  2. Repo Secrets: Add your token as a repository secret (Settings > Secrets and variables > Actions).

Create a workflow file at .github/workflows/ekline.yml.

Copy this configuration to run EkLine on every pull request:

name: EkLine
on:
push:
branches:
- master
- main
pull_request:
jobs:
test-pr-review:
if: github.event_name == 'pull_request'
name: runner / EkLine Reviewer (github-pr-review)
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: ekline-io/ekline-github-action@v6
with:
content_dir: ./src/docs
ek_token: ${{ secrets.ek_token }}
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
filter_mode: added
# ignore_rule: "EK00001,EK00004" # Optional
# exclude_directories: "node_modules" # Optional: one per line for multiple
# exclude_files: "README.md" # Optional: one per line for multiple

Below are all available configuration options for the EkLine GitHub Action:

OptionDescriptionFormat or Allowed ValuesDefault
content_dirThe content directory relative to the root directory.String, which is a relative path..
ek_tokenThe EkLine integration token.String
github_tokenThe GITHUB_TOKEN, allows commenting and status updates.String, secret or ${{ secrets.github_token }}${{ secrets.github_token }}
reporterHow EkLine reports results. [github-pr-check, github-check, github-pr-review]Stringgithub-pr-review
filter_modeFiltering mode for results. [added, diff_context, file, nofilter]Stringadded
ignore_ruleComma-separated list of rule identifiers to ignore.String, for example, “EK00001,EK00004”
exclude_directoriesDirectories to exclude from review, one per line for multiple values.String, for example, "node_modules"
exclude_filesFiles to exclude from review, one per line for multiple values.String, for example, "README.md"

Control how EkLine filters results by specifying the filter_mode option:

  • added default: Filter results by added or modified lines.
  • diff_context: Filter results by diff context, including changed lines plus surrounding context lines.
  • file: Filter results by added or modified file. EkLine reports results for any added or modified file, even if the results fall outside the actual diff.
  • nofilter: Don’t filter any results. Useful for posting results as comments as much as possible and checking other results in the console simultaneously.
  • github-pr-check: Reports results to GitHub Checks.
  • github-check: Similar to github-pr-check, but works for both pull requests and commits.
  • github-pr-review: Reports results to GitHub pull request review comments using a GitHub personal access token.

Use the ignore_rule flag with a comma-separated list of rule identifiers to skip specific rules.

For example, to ignore rules EK00001 and EK00004, add the following to your configuration:

ignore_rule: "EK00001,EK00004"

Save and commit the workflow file to your repository. The EkLine GitHub Action runs automatically when you push changes to the master or main branches or create a pull request.

Add the EkLine integration token to your repository secrets

Section titled “Add the EkLine integration token to your repository secrets”
GitHub repository Settings page showing Actions secrets and variables with EK_TOKEN added as a repository secret

To enable the EkLine GitHub Action to add comments to pull requests, you must grant write permissions to workflows. There are two ways to achieve this:

  1. Navigate to Settings > Code and Automation > Actions > General > Workflow permissions.
  2. Click the drop-down menu and select Read and write permissions.
  3. Click Save to apply the changes.
GitHub Actions General settings showing Workflow permissions with Read and write permissions selected

Add the following permissions block to your workflow file:

permissions:
contents: read
pull-requests: write

Once the EkLine GitHub Action runs, you can view the results in the “Actions” tab of your repository.

Your repository is now configured for automated documentation review with the EkLine GitHub Action.

EkLine GitHub Action on Label