Skip to content

Commit f66648c

Browse files
committed
Add ownerNoPings option to prevent GitHub pings
1 parent dad98b0 commit f66648c

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

README.md

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

8989
## Config
9090

91-
There are five options available at the moment:
91+
There are six 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.
9595
- `quiet` - does not output a message saying who can merge PRs
96+
- `ownerNoPings` - list of usernames to wrap mention in an inline code block to prevent pinging
9697

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

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ inputs:
3232
default: ''
3333
required: false
3434

35+
ownerNoPings:
36+
description: 'Wrap mention in inline code block to prevent pings'
37+
default: '[]'
38+
required: false
39+
3540
runs:
3641
using: 'node12'
3742
main: 'index.js'

index.js

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

60-
60+
6161

6262

6363
// Determine who has access to merge every file in this PR
@@ -94,7 +94,11 @@ async function commentOnMergablePRs() {
9494
process.exit(0)
9595
}
9696

97-
const owners = new Intl.ListFormat().format(ownersWhoHaveAccessToAllFilesInPR);
97+
const ownerNoPings = JSON.parse(core.getInput('ownerNoPings'))
98+
const formattedOwnersWhoHaveAccessToAllFilesInPR = ownersWhoHaveAccessToAllFilesInPR.map((owner) => {
99+
return ownerNoPings.includes(owner) ? `\`${owner}\`` : owner
100+
})
101+
const owners = new Intl.ListFormat().format(formattedOwnersWhoHaveAccessToAllFilesInPR);
98102
const message = `Thanks for the PR!
99103
100104
This section of the codebase is owned by ${owners} - if they write a comment saying "LGTM" then it will be merged.

0 commit comments

Comments
 (0)