Personal Telegram developer console for GitHub
fix(github): preserve commit route compatibility
davoodmehraban89 committed
Oct 4, 2026 at 17:45 UTC
686ee5d89850b41fc4c48215da70440eaf8d871b
1 file changed
+2
-2
src/plugins/github/plugin.js
+2
-2
@@ -158,7 +158,7 @@ async function commitDetailView(github, repoId, sha) {
158
.map(file => `• <code>${escapeHtml(short(file.filename, 90))}</code> · ${escapeHtml(file.status || 'changed')} · +${file.additions ?? 0}/-${file.deletions ?? 0}`)
159
.join('\n');
160
return {
161
- text: `📝 <b>Commit — ${escapeHtml(repo.name)}</b>\n<code>${escapeHtml(commit.shortSha || String(commit.sha).slice(0, 7))}</code> · ${escapeHtml(commit.author || 'Unknown')}\n${escapeHtml(commit.date || '-')}\n+<b>${commit.additions ?? 0}</b>/-<b>${commit.deletions ?? 0}</b> · ${commit.changedFiles ?? (commit.files || []).length} files\n➖➖➖➖➖➖➖➖➖➖\n${escapeHtml(short(commit.message || '', 1200)) || '<i>بدون پیام.</i>'}\n\n<b>فایلهای تغییرکرده</b>\n${files || '<i>فایلی گزارش نشده است.</i>'}`,
161
+ text: `📝 <b>Commit — ${escapeHtml(repo.name)}</b>\n<code>${escapeHtml(commit.shortSha || String(commit.sha).slice(0, 7))}</code> · ${escapeHtml(commit.author || 'Unknown')}\n${escapeHtml(commit.date || '-')}\n+${commit.additions ?? 0}/-${commit.deletions ?? 0} · ${commit.changedFiles ?? (commit.files || []).length} files\n➖➖➖➖➖➖➖➖➖➖\n${escapeHtml(short(commit.message || '', 1200)) || '<i>بدون پیام.</i>'}\n\n<b>فایلهای تغییرکرده</b>\n${files || '<i>فایلی گزارش نشده است.</i>'}`,
162
reply_markup: { inline_keyboard: [[{ text: '🔄 بروزرسانی', callback_data: `commitdetail:${repoId}:${sha}` }, { text: '🔙 Commitها', callback_data: `commits:${repoId}` }], [{ text: '🔙 پروژه', callback_data: `repo:${repoId}` }]] }
163
};
164
}
@@ -515,7 +515,7 @@ export function createGitHubPlugin({ github, menu, workspaces } = {}) {
515
actionId: read.actionId,
516
execute: async () => {
517
if (read.kind === 'repo') return addRepoAdvancedButtons(await menu.renderByCallback(data), read.repoId);
518
- if (read.kind === 'commits') return commitsView(github, read.repoId);
518
+ if (read.kind === 'commits') return typeof github.listCommits === 'function' ? commitsView(github, read.repoId) : menu.renderByCallback(data);
519
if (read.kind === 'commitdetail') return commitDetailView(github, read.repoId, read.sha);
520
if (read.kind === 'runs') return workflowRunsView(github, read.repoId, read.page);
521
if (read.kind === 'run') return workflowRunView(github, read.repoId, read.runId);