Feature request(GitHub App): Specify label name to be reviewed in .env
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_LABELto .env. https://github.com/anc95/ChatGPT-CodeReview/blob/main/.env.example -
add a label check in bot.ts If
TARGET_LABELis 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 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 Thank you for your reply! I made a PR for this issue. Hope it helps. https://github.com/anc95/ChatGPT-CodeReview/pull/77