8 lines
446 B
JavaScript
8 lines
446 B
JavaScript
|
|
// Gitea Actions CI failure alert
|
||
|
|
// Receives: { text: "CI FAILED: repo @ branch — url" }
|
||
|
|
// Posted by the notify-failure job in each repo's lint.yml
|
||
|
|
var msg = data.text || data.body || '';
|
||
|
|
var lines = ['🔴 ' + msg];
|
||
|
|
var htmlParts = ['🔴 <b>CI Failure</b><br>' + msg.replace(/—\s*(https?:\/\/\S+)/, '— <a href="$1">View Run</a>')];
|
||
|
|
result = { version: 'v2', plain: lines.join('\n'), html: htmlParts.join('<br>'), msgtype: 'm.notice' };
|