@@ -211,18 +211,20 @@ jobs:
211211 });
212212
213213 const existingCommentForCommit = comments.data.find(c =>
214- c.body.includes('## 📖 Netlify Preview Ready!') &&
215- c.body.includes(`**Commit:** \` ${commitSha}\` `)
214+ c.body.includes('** 📖 Netlify Preview Ready!** ') &&
215+ c.body.includes(`([ ${commitSha.substring(0, 7)}] `)
216216 );
217217
218218 if (existingCommentForCommit) {
219219 console.log(`Comment already exists for commit ${commitSha}, skipping...`);
220220 return;
221221 }
222222
223- let comment = `## 📖 Netlify Preview Ready!\n\n`;
224- comment += `**Preview URL:** ${deployUrl}\n\n`;
225- comment += `**Commit:** \`${{ github.sha }}\`\n\n`;
223+ const shortSha = commitSha.substring(0, 7);
224+ const commitUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/commit/${commitSha}`;
225+
226+ let comment = `**📖 Netlify Preview Ready!**\n\n`;
227+ comment += `**Preview URL:** ${deployUrl} ([${shortSha}](${commitUrl}))\n\n`;
226228
227229 // Add manual preview page if specified
228230 if (manualPage) {
@@ -233,15 +235,17 @@ jobs:
233235 if (changedFiles) {
234236 const files = changedFiles.split('\n').filter(f => f.trim());
235237 if (files.length > 0) {
236- comment += `📚 **Changed Lecture Pages:**\n `;
238+ comment += `📚 **Changed Lecture Pages:** `;
237239
240+ const pageLinks = [];
238241 for (const file of files) {
239242 if (file.trim()) {
240243 const fileName = file.replace('lectures/', '').replace('.md', '');
241244 const pageUrl = `${deployUrl}/${fileName}.html`;
242- comment += `- [${fileName}](${pageUrl})\n` ;
245+ pageLinks.push(` [${fileName}](${pageUrl})`) ;
243246 }
244247 }
248+ comment += pageLinks.join(', ') + '\n\n';
245249 }
246250 }
247251
0 commit comments