From 9a84b4b1843192de8ec45704f704e91d358f06d2 Mon Sep 17 00:00:00 2001 From: idavidov Date: Wed, 16 Aug 2023 12:56:15 +0300 Subject: [PATCH 1/2] + digest usage for docker in Istallation part of readme --- INSTALL.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 4589e30f..7b714bf9 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -18,6 +18,18 @@ docker run --rm -it -e OPENAI.KEY= -e GITHUB.USER_TOKEN= c ``` docker run --rm -it -e OPENAI.KEY= -e GITHUB.USER_TOKEN= codiumai/pr-agent --pr_url ask "" ``` +Note: If you want to ensure you're running a specific version of the Docker image, consider using the image's digest. +The digest is a unique identifier for a specific version of an image. You can pull and run an image using its digest by referencing it like so: repository@sha256:digest. Always ensure you're using the correct and trusted digest for your operations. + +1. To request a review for a PR using a specific digest, run the following command: +``` +docker run --rm -it -e OPENAI.KEY= -e GITHUB.USER_TOKEN= codiumai/pr-agent@sha256:71b5ee15df59c745d352d84752d01561ba64b6d51327f97d46152f0c58a5f678 --pr_url review +``` + +2. To ask a question about a PR using the same digest, run the following command: +``` +docker run --rm -it -e OPENAI.KEY= -e GITHUB.USER_TOKEN= codiumai/pr-agent@sha256:71b5ee15df59c745d352d84752d01561ba64b6d51327f97d46152f0c58a5f678 --pr_url ask "" +``` Possible questions you can ask include: From 7803d8eec47b8ebea3573a4a04c4f2b2b839429d Mon Sep 17 00:00:00 2001 From: idavidov Date: Wed, 16 Aug 2023 14:22:14 +0300 Subject: [PATCH 2/2] + pin to specific commit with gihub actions in Istallation part of readme --- INSTALL.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 7b714bf9..b7d860a5 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -22,12 +22,12 @@ Note: If you want to ensure you're running a specific version of the Docker imag The digest is a unique identifier for a specific version of an image. You can pull and run an image using its digest by referencing it like so: repository@sha256:digest. Always ensure you're using the correct and trusted digest for your operations. 1. To request a review for a PR using a specific digest, run the following command: -``` +```bash docker run --rm -it -e OPENAI.KEY= -e GITHUB.USER_TOKEN= codiumai/pr-agent@sha256:71b5ee15df59c745d352d84752d01561ba64b6d51327f97d46152f0c58a5f678 --pr_url review ``` 2. To ask a question about a PR using the same digest, run the following command: -``` +```bash docker run --rm -it -e OPENAI.KEY= -e GITHUB.USER_TOKEN= codiumai/pr-agent@sha256:71b5ee15df59c745d352d84752d01561ba64b6d51327f97d46152f0c58a5f678 --pr_url ask "" ``` @@ -63,7 +63,24 @@ jobs: OPENAI_KEY: ${{ secrets.OPENAI_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` +** if you want to pin your action to a specific commit for stability reasons +```yaml +on: + pull_request: + issue_comment: +jobs: + pr_agent_job: + runs-on: ubuntu-latest + name: Run pr agent on every pull request, respond to user comments + steps: + - name: PR Agent action step + id: pragent + uses: Codium-ai/pr-agent@ + env: + OPENAI_KEY: ${{ secrets.OPENAI_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +``` 2. Add the following secret to your repository under `Settings > Secrets`: ```