From 69123645f28cf8efb5f2d4ce3704f7bd6958fef8 Mon Sep 17 00:00:00 2001 From: Mohamed DAADAA Date: Sat, 27 Jul 2024 17:41:39 +0200 Subject: [PATCH 1/6] Add Codium PR Agent GitHub Action --- .github/workflows/pr_agent.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pr_agent.yml diff --git a/.github/workflows/pr_agent.yml b/.github/workflows/pr_agent.yml new file mode 100644 index 0000000..7b1d677 --- /dev/null +++ b/.github/workflows/pr_agent.yml @@ -0,0 +1,30 @@ +on: + pull_request: + types: [opened, reopened, ready_for_review] + issue_comment: +jobs: + pr_agent_job: + if: ${{ github.event.sender.type != 'Bot' }} + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + contents: write + 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@main + env: + OPENAI_KEY: ${{ secrets.OPENAI_KEY }} + TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }} + # ------------- pin the action to a specific release for stability + # steps: + # - name: PR Agent action step + # id: pragent + # uses: docker://codiumai/pr-agent:0.23-github_action + # --------- specify the Docker image + #steps: + # - name: PR Agent action step + # id: pragent + # uses: docker://codiumai/pr-agent@sha256:14165e525678ace7d9b51cda8652c2d74abb4e1d76b57c4a6ccaeba84663cc64 From f2bdff7d553f9be8ea5b6dfb6b60430f26dd99c3 Mon Sep 17 00:00:00 2001 From: Mohamed DAADAA Date: Sat, 27 Jul 2024 17:44:22 +0200 Subject: [PATCH 2/6] Test PR Agent integration --- README.md | Bin 1077 -> 1164 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 3d530348c4ea669d721708003707e411e6d1ca3a..808130cda43affaab187b9c0f538fc8e927cd447 100644 GIT binary patch delta 234 zcmdnW(ZeaKtl*ZIoa&NVlA2tSnV;uaP{7N@J5e}I21s!!D=WC9mZj$87v!eql_(Ua z7L}zIf#fI7kb=rP=clA96elO9rRC?OWagywsKVx1U}m_9>{i%VHq!8t!ARiQXJ zF)b}WCnYm4ooliu<3et*lv8PDP72rLpNvV2T$AINfVw7^Glc@l^Gq^8@*UGAA+S2P X(xQ@#)FOq9)SLpY$=jG`FmeF^!#E}b From f0c63c07e0a8f787621625dcc6ac91df42292182 Mon Sep 17 00:00:00 2001 From: Mohamed DAADAA Date: Sun, 28 Jul 2024 16:38:55 +0200 Subject: [PATCH 3/6] Add block.txt to trigger PR block --- block.txt | Bin 0 -> 66 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 block.txt diff --git a/block.txt b/block.txt new file mode 100644 index 0000000000000000000000000000000000000000..c8ae7bf94b4084b0cb5dd19336423508f02e4b13 GIT binary patch literal 66 zcmezWFN7h3A(Nq)L4hF+Narx50$Jr?Rt}I=!cYWcrvqUskfp$o2*gQ1Rrw6b4A~64 H3|tHV0TvAf literal 0 HcmV?d00001 From 301db0892b1c7905608f0733a39499d1cae3523c Mon Sep 17 00:00:00 2001 From: Mohamed DAADAA Date: Mon, 29 Jul 2024 00:45:42 +0200 Subject: [PATCH 4/6] Add block.txt to trigger PR block --- .github/workflows/pr_agent.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_agent.yml b/.github/workflows/pr_agent.yml index 7b1d677..259e5c9 100644 --- a/.github/workflows/pr_agent.yml +++ b/.github/workflows/pr_agent.yml @@ -12,12 +12,22 @@ jobs: contents: write name: Run PR Agent on every pull request, respond to user comments steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Fail if block.txt is present + run: | + if [ -f block.txt ]; then + echo "Error: block.txt is present" + exit 1 + fi + - name: PR Agent action step id: pragent uses: Codium-ai/pr-agent@main env: OPENAI_KEY: ${{ secrets.OPENAI_KEY }} - TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # ------------- pin the action to a specific release for stability # steps: # - name: PR Agent action step From ec7a4517c4d81f6b1feee92bcce29a4b54171649 Mon Sep 17 00:00:00 2001 From: Mohamed DAADAA Date: Mon, 29 Jul 2024 00:58:37 +0200 Subject: [PATCH 5/6] Add block.txt to PR --- .github/workflows/pr_agent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_agent.yml b/.github/workflows/pr_agent.yml index 259e5c9..5b38a5c 100644 --- a/.github/workflows/pr_agent.yml +++ b/.github/workflows/pr_agent.yml @@ -27,7 +27,7 @@ jobs: uses: Codium-ai/pr-agent@main env: OPENAI_KEY: ${{ secrets.OPENAI_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }} # ------------- pin the action to a specific release for stability # steps: # - name: PR Agent action step From 3314e52686334c714d4777bef732d27a8dfaed11 Mon Sep 17 00:00:00 2001 From: Mohamed DAADAA Date: Mon, 29 Jul 2024 10:53:27 +0200 Subject: [PATCH 6/6] modify pr_agent --- .github/workflows/pr_agent.yml | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pr_agent.yml b/.github/workflows/pr_agent.yml index 5b38a5c..51dc4dc 100644 --- a/.github/workflows/pr_agent.yml +++ b/.github/workflows/pr_agent.yml @@ -10,31 +10,14 @@ jobs: issues: write pull-requests: write contents: write - name: Run PR Agent on every pull request, respond to user comments + name: Run pr agent on every pull request, respond to user comments steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Fail if block.txt is present - run: | - if [ -f block.txt ]; then - echo "Error: block.txt is present" - exit 1 - fi - - name: PR Agent action step id: pragent uses: Codium-ai/pr-agent@main env: OPENAI_KEY: ${{ secrets.OPENAI_KEY }} - TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }} - # ------------- pin the action to a specific release for stability - # steps: - # - name: PR Agent action step - # id: pragent - # uses: docker://codiumai/pr-agent:0.23-github_action - # --------- specify the Docker image - #steps: - # - name: PR Agent action step - # id: pragent - # uses: docker://codiumai/pr-agent@sha256:14165e525678ace7d9b51cda8652c2d74abb4e1d76b57c4a6ccaeba84663cc64 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github_action_config.auto_review: "true" + github_action_config.auto_describe: "true" + github_action_config.auto_improve: "true"