Skip to content

Commit cb5fac7

Browse files
authored
Merge pull request #74 from puppetlabs/MAINT-improve_logging
(MAINT) Improve logging
2 parents 919ec6f + f31f5fc commit cb5fac7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ see if they are a member of the X organisations and Y teams. If they are not we
66
label the issue with the label `community`. */
77
export async function run(): Promise<void> {
88
try {
9+
core.info('Starting community labeller')
910
// Retrieve our inputs
1011
const labelName = core.getInput('label_name', {required: true})
1112
const labelColor = core.getInput('label_color', {required: true})
@@ -21,12 +22,15 @@ export async function run(): Promise<void> {
2122
}
2223

2324
if (
24-
!(await client.checkOrgMembership(orgs)) &&
25-
!client.isExcludedLogin(loginsToIgnore)
25+
(await client.checkOrgMembership(orgs)) ||
26+
client.isExcludedLogin(loginsToIgnore)
2627
) {
27-
await client.createLabel(labelName, labelColor)
28-
await client.addLabel(labelName)
28+
core.info("Looks like this issue doesn't need labeling! 👍")
29+
return
2930
}
31+
32+
await client.createLabel(labelName, labelColor)
33+
await client.addLabel(labelName)
3034
} catch (error) {
3135
if (error instanceof Error) core.setFailed(error.message)
3236
}

0 commit comments

Comments
 (0)