From f9599bd07602c398111b8d4356caf2ad0466648d Mon Sep 17 00:00:00 2001 From: Oliver Levay Date: Wed, 2 Mar 2022 13:27:55 +0100 Subject: [PATCH] Add JSDOC comments to enable GithubAPI auto-completion --- index.js | 9 +++++++++ lib/stale.js | 3 +++ 2 files changed, 12 insertions(+) diff --git a/index.js b/index.js index b1eab1e..6c8fbf3 100644 --- a/index.js +++ b/index.js @@ -20,6 +20,9 @@ module.exports = async app => { app.on(events, unmark) app.on('schedule.repository', markAndSweep) + /** + * @param {import('probot').Context} context + */ async function unmark (context) { if (!context.isBot) { const stale = await forRepository(context) @@ -44,12 +47,18 @@ module.exports = async app => { } } + /** + * @param {import('probot').Context} context + */ async function markAndSweep (context) { const stale = await forRepository(context) await stale.markAndSweep('pulls') await stale.markAndSweep('issues') } + /** + * @param {import('probot').Context} context + */ async function forRepository (context) { let config = await getConfig(context, 'stale.yml') diff --git a/lib/stale.js b/lib/stale.js index 0c13b8d..b7ee6fe 100644 --- a/lib/stale.js +++ b/lib/stale.js @@ -2,6 +2,9 @@ const schema = require('./schema') const maxActionsPerRun = 30 module.exports = class Stale { + /** + * @param {import('probot').Context['github']} github + */ constructor (github, { owner, repo, logger = console, ...config }) { this.github = github this.logger = logger