From d3c06302a0809c79a65d69e539a5b1cad07756e1 Mon Sep 17 00:00:00 2001 From: YuMin <55650732+yuminn-k@users.noreply.github.com> Date: Tue, 13 Feb 2024 00:10:13 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Update=20OpenAI=20Code=20?= =?UTF-8?q?Review=20workflow=20for=20enhanced=20permissions=20and=20trigge?= =?UTF-8?q?rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update modifies the OpenAI Code Review GitHub Actions workflow to enhance its functionality and fix issues related to permissions and event triggers. Changes: 1. Added `issues: write` permission to allow the workflow to write comments on issues and pull requests. 2. Changed the event trigger from `pull_request_target` to `pull_request`. This change ensures that the workflow is triggered more appropriately for pull requests, enhancing security and accuracy in the context of the PR. 3. Renamed the job from `test` to `code-review` to more accurately reflect its purpose and function. These changes aim to streamline the code review process, ensuring that automated reviews can comment on pull requests effectively and securely. This update also aligns the workflow more closely with standard GitHub Actions practices and conventions. Related issue: #5 --- .github/workflows/openai_code_review.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/openai_code_review.yml b/.github/workflows/openai_code_review.yml index cf9ee80..fd4eddf 100644 --- a/.github/workflows/openai_code_review.yml +++ b/.github/workflows/openai_code_review.yml @@ -3,12 +3,13 @@ name: OpenAI Code Review permissions: contents: read pull-requests: write + issues: write on: - pull_request_target: + pull_request: types: [opened, synchronize] jobs: - test: + code-review: runs-on: ubuntu-latest steps: - uses: anc95/ChatGPT-CodeReview@main