Skip to content

Commit d321b8b

Browse files
Add JSDoc
1 parent c6af806 commit d321b8b

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

plugins/filters/checklist/index.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1+
/**
2+
* @module checklist
3+
* @description Automatically check PRs against a checklist of conditions.
4+
* This is useful if you want to ensure that PRs meet certain criteria before they can be merged.
5+
* @param {string} Input - A blank string (no input variable is required)
6+
* @param {object} branch - The branch context variable.
7+
* @param {object} files - The files context variable.
8+
* @param {object} pr - The pr context variable.
9+
* @param {object} repo - The repo context variable.
10+
* @param {object} env - The env context variable.
11+
* @param {object} source - The source context variable.
12+
* @returns {string} Returns a formatted GitHub comment with a checklist of conditions that the PR meets.
13+
* @example
14+
* - action: add-comment@v1
15+
args:
16+
comment: {{ "" | checklist(branch, files, pr, repo, env, source) }}
17+
* @license MIT
18+
**/
19+
120
const checklistFilter = async (empty, branch, files, pr, repo, env, source, callback) => { // made sync temporarily
2-
// Now that we have all the needed data here, we can use it to build our checklist
3-
4-
/*
5-
This is an array of objects, each of which represents a check.
6-
Not all *must* be true for the PR to be accepted, which is why
7-
we don't just put them as automation conditions in the .cm file.
8-
*/
21+
922
const checks = [
1023
{
1124
title: "low-risk",

0 commit comments

Comments
 (0)