Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Add JSDOC comments to enable GithubAPI auto-completion #363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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')

Expand Down
3 changes: 3 additions & 0 deletions lib/stale.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down