Skip to content

Commit c2840bd

Browse files
committed
CONT-1219 : eslint-disable-next-line
1 parent 81f49aa commit c2840bd

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/main.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,27 @@ export async function run(): Promise<void> {
1616
const token = core.getInput('token', {required: true})
1717
const client = new GitHubClient(token)
1818
const labels = client.getLabels()
19-
20-
if (labels && labels.includes(labelName)) {
21-
// "community" label exists
22-
core.info(`The '${labelName}' label is already present on this issue! 🙌`)
23-
return
24-
}
19+
const hasCommunityLabel = labels && !labels.includes(labelName)
2520

2621
if (
2722
(await client.checkOrgMembership(orgs)) ||
2823
client.isExcludedLogin(loginsToIgnore)
2924
) {
3025
if (failIfMember === 'true' && !labels) {
31-
core.setFailed('The PR does not have a label, please add one!')
26+
core.setFailed(
27+
'The PR does not have the required label, please add it!'
28+
)
3229
} else {
3330
core.info("Looks like this issue doesn't need labeling! 👍")
3431
}
3532
return
3633
}
3734

35+
if (hasCommunityLabel) {
36+
core.setFailed('Community PR must have a label community, please add it!')
37+
return
38+
}
39+
3840
await client.createLabel(labelName, labelColor)
3941
await client.addLabel(labelName)
4042
} catch (error) {

0 commit comments

Comments
 (0)