this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: include latest commit message in update success notification

+19 -3
+7 -1
bot/telegrambot/commands/update.js
··· 37 37 const updateResult = await updater.manualUpdate(); 38 38 39 39 if (updateResult.success) { 40 - await this.bot.editMessageText('Update successful! Bot will restart to apply changes.', { 40 + let successMessage = 'Update successful!'; 41 + if (updateResult.commitMessage) { 42 + successMessage += `\n\n📝 Latest commit:\n${updateResult.commitMessage}`; 43 + } 44 + successMessage += '\n\nBot will restart to apply changes.'; 45 + 46 + await this.bot.editMessageText(successMessage, { 41 47 chat_id: chatId, 42 48 message_id: statusMessage.message_id 43 49 });
+12 -2
utils/updater.js
··· 207 207 208 208 /** 209 209 * Manually trigger an update check 210 - * @returns {Promise<{success: boolean, error?: string}>} Object with success status and error message if failed 210 + * @returns {Promise<{success: boolean, error?: string, commitMessage?: string}>} Object with success status, error message if failed, and commit message if successful 211 211 */ 212 212 async manualUpdate() { 213 213 try { ··· 310 310 } 311 311 } 312 312 313 + // Step 9: Get the latest commit message 314 + let commitMessage = ''; 315 + try { 316 + const commitResult = await execAsync('git log -1 --pretty=format:"%h - %s (%an, %ar)"'); 317 + commitMessage = commitResult.stdout.trim(); 318 + console.log(`Latest commit: ${commitMessage}`); 319 + } catch (error) { 320 + console.error('Warning: Could not get commit message:', error); 321 + } 322 + 313 323 console.log('Update completed successfully'); 314 - return { success: true }; 324 + return { success: true, commitMessage }; 315 325 } catch (error) { 316 326 console.error('Unexpected error during manual update:', error); 317 327 return {