chore: tweak debugging output
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import logger from './logger.mjs';
|
||||
|
||||
function truncate(str, len = 26) {
|
||||
if (str.length <= len) return str;
|
||||
return `${str.slice(0, len)}...`;
|
||||
}
|
||||
|
||||
export default async function getEvents(repo, { body, actor } = {}) {
|
||||
const events = await repo.events.fetch();
|
||||
|
||||
@@ -32,14 +37,12 @@ export default async function getEvents(repo, { body, actor } = {}) {
|
||||
`SKIP EVENT ${isComment ? `#${comment.payload.issue.number}` : comment.id}: ${
|
||||
comment.type
|
||||
} ${comment.payload.action} by ${comment.actor.login}`,
|
||||
isComment && !bodyMatch && `(${comment.payload.comment.body.slice(0, 30)})`
|
||||
isComment && !bodyMatch && `(${truncate(comment.payload.comment.body)})`
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
logger.debug(`PROCESS #${comment.payload.issue.number}`);
|
||||
|
||||
return {
|
||||
id: comment.id,
|
||||
number: comment.payload.issue.number,
|
||||
|
||||
Reference in New Issue
Block a user