Support RockChat 4.x up

according to field object form https://developer.rocket.chat/reference/api/rest-api/endpoints/team-collaboration-endpoints/chat-endpoints/postmessage#attachment-field-objects .
fill information properly.
This commit is contained in:
Austin Su 2022-03-05 18:29:07 +08:00 committed by GitHub
parent f9a4dd36e4
commit 8c568c473d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,9 +100,10 @@ const giteaEvents = {
for (var i = 0; i < commits.length; i++) { for (var i = 0; i < commits.length; i++) {
var commit = commits[i]; var commit = commits[i];
var shortID = commit.id.substring(0, 7); var shortID = commit.id.substring(0, 7);
output = '[#' + shortID + '](' + commit.url + '): \n' + commit.message
attachment.fields.push({ attachment.fields.push({
value: output, short: false,
title: '[#' + shortID + '](' + commit.url + '): \n',
value: commit.message,
}); });
} }