Skip to content

Commit aedc71a

Browse files
committed
Make discord role id optionnal
1 parent 7036d12 commit aedc71a

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ jobs:
3232
echo "❌ DISCORD_WEBHOOK_URL is not set"
3333
exit 1
3434
fi
35-
if [ -z "${{ secrets.DISCORD_ROLE_ID }}" ]; then
36-
echo "❌ DISCORD_ROLE_ID is not set"
37-
exit 1
35+
# DISCORD_ROLE_ID is optional
36+
if [ -n "${{ secrets.DISCORD_ROLE_ID }}" ]; then
37+
echo "✅ DISCORD_ROLE_ID is set"
38+
else
39+
echo "ℹ️ DISCORD_ROLE_ID is not set (optional)"
3840
fi
3941
echo "✅ All required secrets are set"
4042

scripts/deploy.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ async function setupDiscordWebhook() {
149149
}
150150
}
151151

152-
// Check and set up Discord role tag
152+
// Check and set up Discord role tag (optional)
153153
async function setupDiscordRoleTag() {
154154
let roleTag = process.env.DISCORD_ROLE_ID;
155155
if (roleTag) {
@@ -170,15 +170,19 @@ async function setupDiscordRoleTag() {
170170
});
171171
console.log("✅ Discord role tag is already set");
172172
} catch (error) {
173-
const roleTag = await prompt("Enter your Discord role ID to mention (without @ symbol): ");
174-
try {
175-
execSync(`echo '${roleTag}' | npx wrangler secret put DISCORD_ROLE_ID`, {
176-
stdio: "inherit"
177-
});
178-
console.log("✅ Discord role tag set successfully");
179-
} catch (error) {
180-
console.error("❌ Failed to set Discord role tag:", error.message);
181-
process.exit(1);
173+
const roleTag = await prompt("Enter your Discord role ID to mention (without @ symbol) or press Enter to skip: ");
174+
if (roleTag.trim()) {
175+
try {
176+
execSync(`echo '${roleTag}' | npx wrangler secret put DISCORD_ROLE_ID`, {
177+
stdio: "inherit"
178+
});
179+
console.log("✅ Discord role tag set successfully");
180+
} catch (error) {
181+
console.error("❌ Failed to set Discord role tag:", error.message);
182+
process.exit(1);
183+
}
184+
} else {
185+
console.log("ℹ️ Discord role tag skipped (optional)");
182186
}
183187
}
184188
}

0 commit comments

Comments
 (0)