diff --git a/images/gitlab/gitlab-project-access-token.png b/images/gitlab/gitlab-project-access-token.png index 6056c910..74f56077 100644 Binary files a/images/gitlab/gitlab-project-access-token.png and b/images/gitlab/gitlab-project-access-token.png differ diff --git a/images/gitlab/gitlab-project-id.png b/images/gitlab/gitlab-project-id.png index 21c95216..b6570393 100644 Binary files a/images/gitlab/gitlab-project-id.png and b/images/gitlab/gitlab-project-id.png differ diff --git a/images/gitlab/gitlab-project-webtoken-test.png b/images/gitlab/gitlab-project-webtoken-test.png new file mode 100644 index 00000000..07b20a87 Binary files /dev/null and b/images/gitlab/gitlab-project-webtoken-test.png differ diff --git a/images/gitlab/gitlab-project-webtoken.png b/images/gitlab/gitlab-project-webtoken.png new file mode 100644 index 00000000..4846e577 Binary files /dev/null and b/images/gitlab/gitlab-project-webtoken.png differ diff --git a/images/gitlab/gitlab-show-webtoken.png b/images/gitlab/gitlab-show-webtoken.png new file mode 100644 index 00000000..d5adac6c Binary files /dev/null and b/images/gitlab/gitlab-show-webtoken.png differ diff --git a/settings/gitlab.mdx b/settings/gitlab.mdx index 0f4935dc..1de36ff2 100644 --- a/settings/gitlab.mdx +++ b/settings/gitlab.mdx @@ -8,30 +8,81 @@ icon: 'gitlab' GitLab integration is available on the [Enterprise plan](https://mintlify.com/pricing). - +We use a combination of Access tokens and Webhooks to authenticate and sync changes between GitLab and Mintlify. + +* We use Access tokens to pull information from GitLab Mintlify. +* We use Webhooks so GitLab can notify Mintlify when changes are made. + * This allows Mintlify to create preview deployments when a MR is created. + + + + Within your Mintlify dashboard, click on the `Settings` tab and select [`Git Settings`][git-settings]. + + + Click on `Switch to GitLab` which will open a panel to enter your GitLab information. + + + + - Navigate to your project's `Settings` > `General` and find the Project ID. + In another tab, navigate to your GitLab's project `Settings` > `General` and find the `Project ID`. - - - a. Navigate to your project's `Settings` > `Access Tokens`. + + a. Navigate to your GitLab's project `Settings` > `Access Tokens`. b. Select `Add new token`. - 1. Name the token "Mintlify" - this specific name is important as it will be visible when we make changes on our end. - 2. Choose `read_api` for the scopes. - 3. If you have a private repo, you must set the role as `Reporter`. + 1. Name the token "Mintlify". + 2. If you have a private repo, you must set the role as `Maintainer`. + 3. Choose `api` and `read_api` for the scopes. c. Finally click `Create project access token` and copy the token. + + + + a. Navigate to your GitLab's project `Settings` > `Webhooks`. + + b. In the "URL" field, enter the endpoint `https://leaves.mintlify.com/gitlab-webhook` + + c. Name the webhook "Mintlify". + + d. Paste the Webhook token generated after completing the previous steps. + + + + + e. Select the events you want to trigger the webhook: + - Push events (All branches) + - Merge requests events + f. Click `Add webhook`. + + + - - Contact us [here](https://mintlify.com/enterprise). + + After creating the Webhook: + + a. Click the "Test" dropdown and select "Push events" to send a sample payload to ensure it's configured correctly. + + b. Check your Mintlify dashboard to view the status of your GitLab integration and confirm that the test event was received successfully. + + This will help you verify that everything is working correctly and that your documentation will sync properly with your GitLab repository. + + + + + + Reach out to the Mintlify team if you need help. + Contact us [here](https://mintlify.com/enterprise). + + +[git-settings]: https://dashboard.mintlify.com/settings/deployment/git-settings