tracehubpm / code-review-action

Quality of Code Review Checker, plugin it as GitHub Action
MIT License
7 stars 2 forks source link

Change GHA behaviour #136

Open l3r8yJ opened 3 months ago

l3r8yJ commented 3 months ago

@h1alexbel in cases when reviewer requesting changes action just not triggering; I think it can be applied in cases like that too, wdyt?

h1alexbel commented 3 months ago

@l3r8yJ I think we need to review the whole pull request review. Once pull request accepted this action analyzes all the comments from all the reviews in that pull request. In case of single "LGMT", action will get and probably complain about that. In case of multiple reviews with rejections, finally review will be accepted and trigger action, that will receive all the comments

h1alexbel commented 3 months ago

@l3r8yJ but I like the idea of triggering action on each review

h1alexbel commented 3 months ago

@l3r8yJ If we remove this line from yml file:

-    if: ${{ github.event.review.state == 'approved' }}

Action will be triggered on each review state. Full yml:

name: code-review
on:
 pull_request_review:
   types: submitted
permissions:
  pull-requests: write
  contents: read
jobs:
  check:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - uses: docker://tracehub/code-review-action:latest
        with:
          openai_token: ${{ secrets.OPENAI_TOKEN }}
          openai_model: gpt-4
          github_token: ${{ secrets.GITHUB_TOKEN }}