From 41607150f30ebe4c088fa2e0563a07e775902a19 Mon Sep 17 00:00:00 2001 From: Arun Bhalla Date: Tue, 4 Mar 2025 23:13:31 -0800 Subject: [PATCH] Update documentation to the latest --- _docs/integrations/bitbucket-integration.mdx | 55 ++++++++++++++++++++ _docs/integrations/cli-integration.mdx | 2 +- _docs/integrations/github-action-label.mdx | 5 +- _docs/integrations/github-integration.mdx | 47 +++++++++++------ _docs/integrations/gitlab-integration.mdx | 2 +- _docs/integrations/integrations.mdx | 4 +- _docs/integrations/vscode-integration.mdx | 14 ++--- 7 files changed, 101 insertions(+), 28 deletions(-) create mode 100644 _docs/integrations/bitbucket-integration.mdx diff --git a/_docs/integrations/bitbucket-integration.mdx b/_docs/integrations/bitbucket-integration.mdx new file mode 100644 index 0000000..ff90df9 --- /dev/null +++ b/_docs/integrations/bitbucket-integration.mdx @@ -0,0 +1,55 @@ +--- +title: "EkLine Bitbucket Integration Guide" +label: "Bitbucket Integration" +description: "This guide will walk you through setting up the EkLine integration with Bitbucket." +position: 6 +--- + +## Prerequisites + +1. You have an EkLine API token provided by the EkLine contact person. +2. You have a Bitbucket account and the necessary permissions to configure pipelines. + +## Create `bitbucket-pipelines.yml` file + +Create a new file named **`bitbucket-pipelines.yml`** in your project's root directory and add the following content: + +```yaml +runEkLineStep: &runEkLineStep + name: EkLine Documentation Review + image: + name: ghcr.io/ekline-io/ekline-ci-cd:v6.8 + script: + - export EK_TOKEN=$EK_TOKEN + - export INPUT_CONTENT_DIR='' + - /entrypoint.sh + +pipelines: + branches: + main: + - step: *runEkLineStep + + pull-requests: + '**': + - step: *runEkLineStep +``` + +Replace **``** with the actual path to your content directory. + +## Configure Bitbucket environment variables + +1. In Bitbucket, navigate to your repository settings. +2. Go to **Repository settings > Pipelines > Repository variables**. +3. Add the following variables: + **`EK_TOKEN`**: Your EkLine API token. + +## Configure input options + +### Ignoring specific rules (Optional) + +To ignore specific rules during the review process, you can use the `INPUT_IGNORE_RULE` flag. This flag accepts a comma-separated list of rule identifiers that you wish to skip. + +For example, if you want to ignore rules `EK00001` and `EK00004`, you can set the `INPUT_IGNORE_RULE` flag in your configuration like this: + +```yaml + INPUT_IGNORE_RULE: "EK00001,EK00004" diff --git a/_docs/integrations/cli-integration.mdx b/_docs/integrations/cli-integration.mdx index 42317b2..73547fc 100644 --- a/_docs/integrations/cli-integration.mdx +++ b/_docs/integrations/cli-integration.mdx @@ -39,7 +39,7 @@ Disables suggestions. Please note that suggestions are only generated for **`.js - **i, --ignore ``** -Ignores specified rules during the check. Rules should be passed as comma-separated values. For example, **`EK1,EK4`**. +Ignore specified rules during the check. Pass the rules as comma-separated values. For example, **`EK1,EK4`**. - **cd, --content-directory ``** diff --git a/_docs/integrations/github-action-label.mdx b/_docs/integrations/github-action-label.mdx index 9a4aa20..f6afe98 100644 --- a/_docs/integrations/github-action-label.mdx +++ b/_docs/integrations/github-action-label.mdx @@ -10,6 +10,7 @@ position: 2 - 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. @@ -40,7 +41,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: ekline-io/ekline-github-action@v5.6.0 + - uses: ekline-io/ekline-github-action@v6 with: content_dir: ./src/docs ek_token: ${{ secrets.ek_token }} @@ -54,4 +55,4 @@ With these changes, EkLine GitHub Action triggers when someone adds a label name ## 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. \ No newline at end of file +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. diff --git a/_docs/integrations/github-integration.mdx b/_docs/integrations/github-integration.mdx index 59f4593..b247077 100644 --- a/_docs/integrations/github-integration.mdx +++ b/_docs/integrations/github-integration.mdx @@ -7,17 +7,17 @@ position: 1 ## Prerequisites -Before you begin, make sure you have the following: +Before you begin, ensure you have the following: -- You have an EkLine API token provided by the EkLine contact person. +- An EkLine API token. You can obtain this by navigating to **EkLine.io > Settings > Organization > Access Token**. ## Create a new GitHub Actions workflow In your GitHub repository, navigate to the "Actions" tab. Click "New workflow" and choose the "set up a workflow yourself" option. -In the new workflow file, you can name it **`ekline.yml`**. This file will be stored in the **`.github/workflows/`** directory in your repository. +In the new workflow file, you can name it **`ekline.yml`**. GitHub stores this file in the **`.github/workflows/`** directory in your repository. -## Configure the EkLine GitHub Action +## Configure the EkLine GitHub action Copy and paste the following template into your workflow file: @@ -34,9 +34,12 @@ jobs: 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@v3 - - uses: ekline-io/ekline-github-action@v5.8.0 + - uses: ekline-io/ekline-github-action@v6 with: content_dir: ./src/docs ek_token: ${{ secrets.ek_token }} @@ -54,22 +57,22 @@ Adjust the configuration options as needed for your specific use case. The avail - **`github_token`**: The GITHUB_TOKEN (default: **`${{ secrets.github_token }}`**). - **`reporter`**: The reporter of the EkLine review command [github-pr-check, github-check, github-pr-review] (default: **`github-pr-check`**). -### Filter Modes +### Filter modes You can control how the EkLine reviewer filters results by specifying the **`filter_mode`** option. Available filter modes are as below: - **`added`** (default): Filter results by added or modified lines. - **`diff_context`**: Filter results by diff context. That's, changed lines +-N lines (N=3, for example). -- **`file`**: Filter results by added or modified file. EkLine reviewer will report results as long as they are in an added or modified file, even if the results aren't in the actual diff. +- **`file`**: Filter results by added or modified file. EkLine reviewer reports results as long as they're in an added or modified file, even if the results aren't in 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. -### Reporter Types +### Reporter types - **`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 PullRequest review comments using a GitHub Personal API Access Token. -### Ignoring Specific Rules +### Ignoring specific rules To ignore specific rules during the review process, you can use the `ignore_rule` flag. This flag accepts a comma-separated list of rule identifiers that you wish to skip. @@ -81,7 +84,7 @@ For example, if you want to ignore rules `EK00001` and `EK00004`, you can set th ## Save and commit the workflow file -After configuring the workflow file, click "Start commit" to save and commit the file to your repository. The EkLine GitHub Action will now run automatically when you push changes to the **`master`** or **`main`** branches or create a pull request. +After configuring the workflow file, click "Start commit" to save and commit the 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 API token to your repository secrets @@ -96,28 +99,40 @@ Before the action can work, you need to provide the EkLine API token. Go to your alt={`Update Secrets`} /> -## Grant Write Permissions to Workflows +## Grant write permissions to workflows -To enable the EkLine GitHub Action to add comments to pull requests, you must grant write permissions to workflows. +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: -To do this, navigate to **Settings > Code and Automation > Actions > General > Workflow permissions**. Then, click the drop-down menu and select **"Read and write permissions"**. Click on **"Save"** to apply the changes. +### Option 1: Through repository settings +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 on **Save** to apply the changes. {`Grant +### Option 2: Through the workflow file -## Monitor the EkLine GitHub Action results +Add the following permissions block to your workflow file: + +```yaml +permissions: + contents: read + pull-requests: write +``` + +## Check the EkLine GitHub Action results Once the EkLine GitHub Action runs, you can view the results in the "Actions" tab of your repository. Now, you have integrated the EkLine GitHub Action into your repository for automated documentation review. Enjoy better quality and consistency in your documentation. -### Other options: +## Other options [EkLine GitHub Action on Label](/documentation/github-action-label) \ No newline at end of file diff --git a/_docs/integrations/gitlab-integration.mdx b/_docs/integrations/gitlab-integration.mdx index 320c483..21bfa72 100644 --- a/_docs/integrations/gitlab-integration.mdx +++ b/_docs/integrations/gitlab-integration.mdx @@ -20,7 +20,7 @@ stages: ekline-pr-review-job: stage: ekline-pr-review - image: ghcr.io/ekline-io/ekline-ci-cd:v5.6.0 + image: ghcr.io/ekline-io/ekline-ci-cd:v6 rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' script: diff --git a/_docs/integrations/integrations.mdx b/_docs/integrations/integrations.mdx index 278b290..de0b756 100644 --- a/_docs/integrations/integrations.mdx +++ b/_docs/integrations/integrations.mdx @@ -11,4 +11,6 @@ position: 0 [CLI](/documentation/cli-integration) -[VSCode Integration](/documentation/vscode-integration) \ No newline at end of file +[VSCode Integration](/documentation/vscode-integration) + +[Bitbucket Integration](/documentation/bitbucket-integration) \ No newline at end of file diff --git a/_docs/integrations/vscode-integration.mdx b/_docs/integrations/vscode-integration.mdx index 8bfd5af..3cdf576 100644 --- a/_docs/integrations/vscode-integration.mdx +++ b/_docs/integrations/vscode-integration.mdx @@ -1,17 +1,17 @@ --- title: "EkLine VSCode Integration" -label: "EkLine VSCode Integration" -description: "EkLine flags any style guide violations in your company's code with Visual Studio Code diagnostics. It offers immediate feedback, facilitating consistent writing in your documentation." +label: "VSCode Integration" +description: "EkLine flags any style guide violations in your company's documentation with Visual Studio Code diagnostics. It offers immediate feedback, facilitating consistency in your documentation." position: 5 --- -# Prerequisites +## Prerequisites You have an EkLine API token provided by the EkLine contact person. -# Getting started +## Getting started -## Installation +### Installation To install the VSCode extension from the web, follow these steps: @@ -28,14 +28,14 @@ To install the VSCode extension from within VSCode, 3. Type "EkLine" in the Extensions view search box. 4. Click the "Install" button next to the extension with the same name. -## Configure EkLine linter +### Configure EkLine linter EkLine asks for an API Token at first activation. If you cancel or input an invalid token, the extension displays a popup offering another chance to set up EkLine or turn off for avoiding future popups. Once turned off, execute 'Configure EkLine Linter' from the Command Palette or clear the 'off' box in Extension Settings. -# Usage +## Usage The extension runs EkLine on supported files when opened or saved.