diff --git a/README.md b/README.md index cba68652..3e78dc13 100644 --- a/README.md +++ b/README.md @@ -88,10 +88,11 @@ packages/documentation/copy/es/**/*.ts @KingDarBoja [translate] [es] ## Config -There are four options available at the moment: +There are five options available at the moment: - `cwd`, which can be used to determine the root folder to look for CODEOWNER files in. - `merge_method`, which can be `merge` (default), `squash` or `rebase`, depending on what you want the action to do. +- `quiet` - does not output a message saying who can merge PRs ```yml - name: Run Codeowners merge check diff --git a/action.yml b/action.yml index a75d3614..e2ef1156 100644 --- a/action.yml +++ b/action.yml @@ -27,6 +27,11 @@ inputs: default: '' required: false + quiet: + description: 'Do not say "this PR can be merged by x, y, z" out loud' + default: '' + required: false + runs: using: 'node12' main: 'index.js' diff --git a/index.js b/index.js index b8a2c722..3d05b2a3 100644 --- a/index.js +++ b/index.js @@ -57,6 +57,9 @@ async function commentOnMergablePRs() { process.exit(0) } + + + // Determine who has access to merge every file in this PR const ownersWhoHaveAccessToAllFilesInPR = [] codeowners.users.forEach(owner => { @@ -97,7 +100,11 @@ async function commentOnMergablePRs() { This section of the codebase is owned by ${owners} - if they write a comment saying "LGTM" then it will be merged. ${ourSignature}` - await octokit.issues.createComment({ ...thisRepo, issue_number: pr.number, body: message }); + + const skipOutput = core.getInput('quiet') + if (!skipOutput) { + await octokit.issues.createComment({ ...thisRepo, issue_number: pr.number, body: message }); + } // Add labels for (const label of codeowners.labels) {