From 09a1d74a004c00763ab54a3083c138ffbc8bc4b0 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 5 Aug 2024 15:57:09 +0300 Subject: [PATCH] Add instructions for running PR-Agent as a GitLab pipeline in gitlab.md --- docs/docs/installation/gitlab.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docs/installation/gitlab.md b/docs/docs/installation/gitlab.md index 34706856..3c73bd23 100644 --- a/docs/docs/installation/gitlab.md +++ b/docs/docs/installation/gitlab.md @@ -25,12 +25,14 @@ pr_agent_job: rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_STATE == "opened"' ``` -Note that this script will run PR-Agent on every new merge request. You can modify the `rules` section to run PR-Agent on different events. +This script will run PR-Agent on every new merge request. You can modify the `rules` section to run PR-Agent on different events. You can also modify the `script` section to run different PR-Agent commands, or with different parameters by exporting different environment variables. (2) Add the following masked variables to your GitLab repository (CI/CD -> Variables): + - `GITLAB_PERSONAL_ACCESS_TOKEN`: Your GitLab personal access token. + - `OPENAI_KEY`: Your OpenAI key. Note that if your base branches are not protected, don't set the variables as `protected`, since the pipeline will not have access to them.