commit 9994b49164a0f8317de40d3f14150306d2c0cdab
parent 58353f5662a736dc3a1b5d7918cf324e57a45dd1
Author: iostpa <iostpa@iostpa.com>
Date: Wed, 20 May 2026 15:55:15 +0300
Fix the label system
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/index.js b/index.js
@@ -132,7 +132,18 @@ app.webhooks.on('pull_request.labeled', async ({ octokit, payload }) => {
}
const labelMessages = allMessages.join('\n\n');
- const body = `
+ let body;
+ if (!labelMessages.length) {
+ body = `
+# Invalid Pull Request
+
+This pull request is invalid. Unfortunately the reviewer didn't specify what is wrong with the pull request.
+
+If you need any help, please create an issue or ask our team in the [Discord server](https://discord.gg/is-a-dev-830872854677422150)
+
+`;
+ } else {
+ body = `
# Invalid Pull Request
This pull request is invalid due to the following reason(s):
@@ -145,6 +156,7 @@ ${labelMessages}
If you need any help, please create an issue or ask our team in the [Discord server](https://discord.gg/is-a-dev-830872854677422150)
`;
+ };
await octokit.rest.issues.createComment({
owner: payload.repository.owner.login,
repo: payload.repository.name,