notion-github 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cli.js +14 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
@@ -4558,7 +4558,7 @@ var {
|
|
4558
4558
|
} = import_index.default;
|
4559
4559
|
|
4560
4560
|
// package.json
|
4561
|
-
var version = "1.0.
|
4561
|
+
var version = "1.0.3";
|
4562
4562
|
|
4563
4563
|
// src/commands/create/action.ts
|
4564
4564
|
var import_rest = require("@octokit/rest");
|
@@ -5959,13 +5959,22 @@ async function sendDiscordNotification(webhookUrl, prTitle, prUrl, reviewers, la
|
|
5959
5959
|
if (reviewers && reviewers.length > 0) {
|
5960
5960
|
message.push(``, `\u{1F465} ${lang === "ko" ? "\uB9AC\uBDF0\uC5B4" : "Reviewers"}: ${reviewers.map((r) => `@${r}`).join(", ")}`);
|
5961
5961
|
}
|
5962
|
+
const payload = { content: message.join("\n") };
|
5963
|
+
console.log("Sending Discord notification:", payload);
|
5962
5964
|
try {
|
5963
|
-
await lib_default(webhookUrl, {
|
5965
|
+
const response = await lib_default(webhookUrl, {
|
5964
5966
|
method: "POST",
|
5965
5967
|
headers: { "Content-Type": "application/json" },
|
5966
|
-
body: JSON.stringify(
|
5968
|
+
body: JSON.stringify(payload)
|
5967
5969
|
});
|
5970
|
+
if (!response.ok) {
|
5971
|
+
const errorText = await response.text();
|
5972
|
+
console.error("Discord API Error:", errorText);
|
5973
|
+
throw new Error(`Discord API returned ${response.status}`);
|
5974
|
+
}
|
5975
|
+
console.log("Discord notification sent successfully");
|
5968
5976
|
} catch (error) {
|
5977
|
+
console.error("Discord notification error:", error);
|
5969
5978
|
throw new Error(lang === "ko" ? "\uB514\uC2A4\uCF54\uB4DC \uC54C\uB9BC \uC804\uC1A1 \uC2E4\uD328" : "Failed to send Discord notification");
|
5970
5979
|
}
|
5971
5980
|
}
|
@@ -6036,6 +6045,7 @@ ${error.message}`);
|
|
6036
6045
|
}
|
6037
6046
|
console.log(getMessage("prCreateSuccess", lang, response.data.html_url));
|
6038
6047
|
if (config.discordWebhook) {
|
6048
|
+
console.log("Discord webhook URL:", config.discordWebhook);
|
6039
6049
|
try {
|
6040
6050
|
await sendDiscordNotification(
|
6041
6051
|
config.discordWebhook,
|
@@ -6046,6 +6056,7 @@ ${error.message}`);
|
|
6046
6056
|
);
|
6047
6057
|
console.log(getMessage("discordNotificationSent", lang));
|
6048
6058
|
} catch (error) {
|
6059
|
+
console.error("Discord error:", error);
|
6049
6060
|
console.error(getMessage("discordNotificationFailed", lang, error.message));
|
6050
6061
|
}
|
6051
6062
|
}
|