File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed
Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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)
153153async 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 }
You can’t perform that action at this time.
0 commit comments