Skip to content

Commit ef64de3

Browse files
committed
feat: print log if core.isDebug()
1 parent db819c8 commit ef64de3

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
@@ -35,7 +35,9 @@ export async function run(): Promise<void> {
3535
try {
3636
const inps: Inputs = getInputs();
3737

38-
console.log(context);
38+
if (core.isDebug()) {
39+
console.log(context);
40+
}
3941

4042
const eventName = context.eventName;
4143
const labelEvent = context.payload.action;
@@ -59,7 +61,9 @@ export async function run(): Promise<void> {
5961

6062
const configFilePath = inps.ConfigFilePath;
6163
const config = yaml.safeLoad(fs.readFileSync(configFilePath, 'utf8'));
62-
console.log(config);
64+
if (core.isDebug()) {
65+
console.log(config);
66+
}
6367

6468
let isExistLabel = false;
6569
let labelIndex = '';
@@ -73,12 +77,12 @@ export async function run(): Promise<void> {
7377
});
7478

7579
if (!isExistLabel) {
76-
core.info(`no configuration for ${labelName}`);
80+
core.info(`[INFO] no configuration for ${labelName}`);
7781
return;
7882
}
7983

8084
if (config.labels[labelIndex][`${labelEvent}`] === void 0) {
81-
core.info(`no configuration for ${labelName} ${labelEvent}`);
85+
core.info(`[INFO] no configuration for ${labelName} ${labelEvent}`);
8286
return;
8387
}
8488

0 commit comments

Comments
 (0)