Skip to content

Commit e8b5385

Browse files
committed
Document quiet mode
1 parent 705769e commit e8b5385

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ packages/documentation/copy/es/**/*.ts @KingDarBoja [translate] [es]
8888

8989
## Config
9090

91-
There are four options available at the moment:
91+
There are five options available at the moment:
9292

9393
- `cwd`, which can be used to determine the root folder to look for CODEOWNER files in.
9494
- `merge_method`, which can be `merge` (default), `squash` or `rebase`, depending on what you want the action to do.
95+
- `quiet` - does not output a message saying who can merge PRs
9596

9697
```yml
9798
- name: Run Codeowners merge check

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ inputs:
2727
default: ''
2828
required: false
2929

30+
quiet:
31+
description: 'Do not say "this PR can be merged by x, y, z" out loud'
32+
default: ''
33+
required: false
34+
3035
runs:
3136
using: 'node12'
3237
main: 'index.js'

index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ async function commentOnMergablePRs() {
5757
process.exit(0)
5858
}
5959

60+
61+
62+
6063
// Determine who has access to merge every file in this PR
6164
const ownersWhoHaveAccessToAllFilesInPR = []
6265
codeowners.users.forEach(owner => {
@@ -97,7 +100,11 @@ async function commentOnMergablePRs() {
97100
This section of the codebase is owned by ${owners} - if they write a comment saying "LGTM" then it will be merged.
98101
${ourSignature}`
99102

100-
await octokit.issues.createComment({ ...thisRepo, issue_number: pr.number, body: message });
103+
104+
const skipOutput = core.getInput('quiet')
105+
if (!skipOutput) {
106+
await octokit.issues.createComment({ ...thisRepo, issue_number: pr.number, body: message });
107+
}
101108

102109
// Add labels
103110
for (const label of codeowners.labels) {

0 commit comments

Comments
 (0)