GitHub Action on Label

This guide helps configure the EkLine GitHub Action to run when a specific label, named 'ekline', gets added to a pull request.

Prerequisites

  • A GitHub repository with EkLine set up.
  • EkLine GitHub Action configured in your repository.

Steps

  1. Open the .github/workflows/ekline.yml file in your GitHub repository.
  2. Change the on section of the GitHub action to trigger on pull_request with types: [labeled]:
on:
  pull_request:
    types: [labeled]
  1. Add a new if condition to the jobs section to check if the label "ekline" is present:
jobs:
  test-pr-review:
    if: contains(github.event.label.name, 'ekline')
  1. Save the changes to ekline.yml file. The updated ekline.yml appears like this:
name: EkLine
on:
  pull_request:
    types: [labeled]

jobs:
  test-pr-review:
    if: contains(github.event.label.name, 'ekline')
    name: runner / EkLine Reviewer (github-pr-review)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - 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

With these changes, EkLine GitHub Action triggers when someone adds a label named "ekline" to a pull request.

Usage

Add the "ekline" label to a specific pull request to run the EkLine GitHub Action. Upon adding the label, the action triggers and executes the configured checks.