Skip to content

Commit e028a21

Browse files
authored
Fix Watch Event
Use correct watchers_count field instead of undefined subscribers_count
1 parent 5cf1b44 commit e028a21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/github-webhook.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ module.exports = async (req, res) => {
412412
url: repository.html_url,
413413
description: `${sender.login} started watching ${repository.full_name}`,
414414
fields: [
415-
{ name: 'Watchers', value: `${repository.subscribers_count}`, inline: true }
415+
{ name: 'Watchers', value: `${repository.watchers_count || repository.watchers || 0}`, inline: true }
416416
],
417417
footer: {
418418
text: `GitHub`,
@@ -495,4 +495,4 @@ module.exports = async (req, res) => {
495495
console.error('Error:', error);
496496
res.status(500).send('Error');
497497
}
498-
};
498+
};

0 commit comments

Comments
 (0)