fix(push): show commit links inline with messages

This commit is contained in:
RhenCloud 2026-08-03 09:23:32 +08:00
parent 5834861a8d
commit e01ce3505e
No known key found for this signature in database
GPG key ID: A574A617378C4E0B

View file

@ -46,9 +46,8 @@ export function formatPush(
const commitField = (c: (typeof commits)[number]): { name: string; value: string } => {
const shortId = c.id?.slice(0, 7) ?? "???????";
const msg = c.message?.split("\n")[0].slice(0, 72) ?? t("common.no_message");
const name =
repo && c.id ? `[${shortId}](https://github.com/${repo}/commit/${c.id})` : `\`${shortId}\``;
return { name, value: msg };
const url = repo && c.id ? `https://github.com/${repo}/commit/${c.id}` : null;
return { name: `\`${shortId}\``, value: url ? `[${shortId}](${url}) — ${msg}` : msg };
};
if (count <= 5) {