Skip to content

Commit d836430

Browse files
committed
fixed numbers
1 parent b4776d5 commit d836430

File tree

1 file changed

+39
-37
lines changed

1 file changed

+39
-37
lines changed

docs/docs/installation/github.md

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
You can use our pre-built Github Action Docker image to run PR-Agent as a Github Action.
44

5-
1. Add the following file to your repository under `.github/workflows/pr_agent.yml`:
5+
1) Add the following file to your repository under `.github/workflows/pr_agent.yml`:
66

77
```yaml
88
on:
@@ -46,7 +46,7 @@ jobs:
4646
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
4747
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4848
```
49-
2. Add the following secret to your repository under `Settings > Secrets and variables > Actions > New repository secret > Add secret`:
49+
2) Add the following secret to your repository under `Settings > Secrets and variables > Actions > New repository secret > Add secret`:
5050

5151
```
5252
Name = OPENAI_KEY
@@ -55,10 +55,10 @@ Secret = <your key>
5555
5656
The GITHUB_TOKEN secret is automatically created by GitHub.
5757
58-
3. Merge this change to your main branch.
58+
3) Merge this change to your main branch.
5959
When you open your next PR, you should see a comment from `github-actions` bot with a review of your PR, and instructions on how to use the rest of the tools.
6060
61-
4. You may configure PR-Agent by adding environment variables under the env section corresponding to any configurable property in the [configuration](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml) file. Some examples:
61+
4) You may configure PR-Agent by adding environment variables under the env section corresponding to any configurable property in the [configuration](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml) file. Some examples:
6262
```yaml
6363
env:
6464
# ... previous environment values
@@ -72,7 +72,7 @@ When you open your next PR, you should see a comment from `github-actions` bot w
7272
## Run as a GitHub App
7373
Allowing you to automate the review process on your private or public repositories.
7474

75-
1. Create a GitHub App from the [Github Developer Portal](https://docs.github.com/en/developers/apps/creating-a-github-app).
75+
1) Create a GitHub App from the [Github Developer Portal](https://docs.github.com/en/developers/apps/creating-a-github-app).
7676

7777
- Set the following permissions:
7878
- Pull requests: Read & write
@@ -84,60 +84,62 @@ Allowing you to automate the review process on your private or public repositori
8484
- Pull request
8585
- Push (if you need to enable triggering on PR update)
8686

87-
2. Generate a random secret for your app, and save it for later. For example, you can use:
87+
2) Generate a random secret for your app, and save it for later. For example, you can use:
8888

8989
```
9090
WEBHOOK_SECRET=$(python -c "import secrets; print(secrets.token_hex(10))")
9191
```
9292

93-
3. Acquire the following pieces of information from your app's settings page:
93+
3) Acquire the following pieces of information from your app's settings page:
9494

9595
- App private key (click "Generate a private key" and save the file)
9696
- App ID
9797

98-
4. Clone this repository:
98+
4) Clone this repository:
9999

100100
```
101101
git clone https://github.com/Codium-ai/pr-agent.git
102102
```
103103

104-
5. Copy the secrets template file and fill in the following:
105-
```
106-
cp pr_agent/settings/.secrets_template.toml pr_agent/settings/.secrets.toml
107-
# Edit .secrets.toml file
108-
```
104+
5) Copy the secrets template file and fill in the following:
105+
106+
```
107+
cp pr_agent/settings/.secrets_template.toml pr_agent/settings/.secrets.toml
108+
# Edit .secrets.toml file
109+
```
110+
109111
- Your OpenAI key.
110112
- Copy your app's private key to the private_key field.
111113
- Copy your app's ID to the app_id field.
112114
- Copy your app's webhook secret to the webhook_secret field.
113115
- Set deployment_type to 'app' in [configuration.toml](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml)
114116

115-
> The .secrets.toml file is not copied to the Docker image by default, and is only used for local development.
116-
> If you want to use the .secrets.toml file in your Docker image, you can add remove it from the .dockerignore file.
117-
> In most production environments, you would inject the secrets file as environment variables or as mounted volumes.
118-
> For example, in order to inject a secrets file as a volume in a Kubernetes environment you can update your pod spec to include the following,
119-
> assuming you have a secret named `pr-agent-settings` with a key named `.secrets.toml`:
120-
```
121-
volumes:
122-
- name: settings-volume
123-
secret:
124-
secretName: pr-agent-settings
125-
// ...
126-
containers:
127-
// ...
128-
volumeMounts:
129-
- mountPath: /app/pr_agent/settings_prod
130-
name: settings-volume
131-
```
132-
133-
> Another option is to set the secrets as environment variables in your deployment environment, for example `OPENAI.KEY` and `GITHUB.USER_TOKEN`.
117+
> The .secrets.toml file is not copied to the Docker image by default, and is only used for local development.
118+
> If you want to use the .secrets.toml file in your Docker image, you can add remove it from the .dockerignore file.
119+
> In most production environments, you would inject the secrets file as environment variables or as mounted volumes.
120+
> For example, in order to inject a secrets file as a volume in a Kubernetes environment you can update your pod spec to include the following,
121+
> assuming you have a secret named `pr-agent-settings` with a key named `.secrets.toml`:
122+
```
123+
volumes:
124+
- name: settings-volume
125+
secret:
126+
secretName: pr-agent-settings
127+
// ...
128+
containers:
129+
// ...
130+
volumeMounts:
131+
- mountPath: /app/pr_agent/settings_prod
132+
name: settings-volume
133+
```
134+
135+
> Another option is to set the secrets as environment variables in your deployment environment, for example `OPENAI.KEY` and `GITHUB.USER_TOKEN`.
134136
135-
6. Build a Docker image for the app and optionally push it to a Docker repository. We'll use Dockerhub as an example:
137+
6) Build a Docker image for the app and optionally push it to a Docker repository. We'll use Dockerhub as an example:
136138
137-
```
138-
docker build . -t codiumai/pr-agent:github_app --target github_app -f docker/Dockerfile
139-
docker push codiumai/pr-agent:github_app # Push to your Docker repository
140-
```
139+
```
140+
docker build . -t codiumai/pr-agent:github_app --target github_app -f docker/Dockerfile
141+
docker push codiumai/pr-agent:github_app # Push to your Docker repository
142+
```
141143
142144
7. Host the app using a server, serverless function, or container environment. Alternatively, for development and
143145
debugging, you may use tools like smee.io to forward webhooks to your local machine.

0 commit comments

Comments
 (0)