Skip to content

Commit

Permalink
Document quiet mode
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Feb 28, 2022
1 parent 705769e commit e8b5385
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e8b5385

Please sign in to comment.