ChatGPT-CodeReview icon indicating copy to clipboard operation
ChatGPT-CodeReview copied to clipboard

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

Open HosakaKeigo opened this issue 2 years ago • 2 comments

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.

  • add label name to .env add label name such as TARGET_LABEL to .env. https://github.com/anc95/ChatGPT-CodeReview/blob/main/.env.example

  • add a label check in bot.ts If TARGET_LABEL is specified in .env, check if the label is attached.

      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)

HosakaKeigo avatar Apr 28 '23 05:04 HosakaKeigo

@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.

anc95 avatar Apr 28 '23 05:04 anc95

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

HosakaKeigo avatar Apr 28 '23 06:04 HosakaKeigo