Skip to content

Commit 4e790d4

Browse files
committed
maint : Adding option fail_if_member
1 parent 9dcf634 commit 4e790d4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export async function run(): Promise<void> {
1111
const labelName = core.getInput('label_name', {required: true})
1212
const labelColor = core.getInput('label_color', {required: true})
1313
const loginsToIgnore = core.getInput('logins_to_ignore', {required: false})
14+
const failIfMember = core.getInput('fail_if_member', { required: false }) || 'false'
1415
const orgs = getOrgMembershipList()
1516
const token = core.getInput('token', {required: true})
1617

@@ -23,10 +24,14 @@ export async function run(): Promise<void> {
2324

2425
// prettier-ignore
2526
if (
26-
(await client.checkOrgMembership(orgs) ||
27-
(client.isExcludedLogin(loginsToIgnore) && !client.hasLabel(labelName)))
27+
(await client.checkOrgMembership(orgs)) ||
28+
client.isExcludedLogin(loginsToIgnore)
2829
) {
29-
core.setFailed('The PR does not have any labels, please add the labels!')
30+
if (failIfMember && !client.hasLabel(labelName)) {
31+
core.setFailed('The PR does not have any labels, please add the labels!')
32+
} else {
33+
core.info("Looks like this issue doesn't need labeling! 👍")
34+
}
3035
return
3136
}
3237

0 commit comments

Comments
 (0)