anc95 / ChatGPT-CodeReview

🐥 A code review bot powered by ChatGPT
https://github.com/apps/cr-gpt
ISC License
3.77k stars 361 forks source link

Feature request(GitHub App): Specify label name to be reviewed in .env #76

Open HosakaKeigo opened 1 year ago

HosakaKeigo commented 1 year ago

Purpose

As per Github Actions version, it would be convenient if you can specify the label name to be reviewed in GitHub App version.

Suggestion

Here's my implementation suggestion.

      const target_label = process.env.TARGET_LABEL
      if (target_label && pull_request.labels.every(label => label.name !== target_label)) {
        return "no target label attached"
      }

https://github.com/anc95/ChatGPT-CodeReview/blob/8833ed9067356702bde83caaedee0627a5ca3de4/src/bot.ts#L61

I also tried to make a PR, but npm test doesn't work for my environment. (Windows / WSL2)

anc95 commented 1 year ago

@HosakaKeigo sorry for the test is not workable yet. Could you help to create a pull request of beyond code, it looks fine to me.

HosakaKeigo commented 1 year ago

@anc95 Thank you for your reply! I made a PR for this issue. Hope it helps. https://github.com/anc95/ChatGPT-CodeReview/pull/77