Skip to content

Commit

Permalink
feat: print log if core.isDebug()
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Mar 7, 2020
1 parent db819c8 commit ef64de3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export async function run(): Promise<void> {
try {
const inps: Inputs = getInputs();

console.log(context);
if (core.isDebug()) {
console.log(context);
}

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

const configFilePath = inps.ConfigFilePath;
const config = yaml.safeLoad(fs.readFileSync(configFilePath, 'utf8'));
console.log(config);
if (core.isDebug()) {
console.log(config);
}

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

if (!isExistLabel) {
core.info(`no configuration for ${labelName}`);
core.info(`[INFO] no configuration for ${labelName}`);
return;
}

if (config.labels[labelIndex][`${labelEvent}`] === void 0) {
core.info(`no configuration for ${labelName} ${labelEvent}`);
core.info(`[INFO] no configuration for ${labelName} ${labelEvent}`);
return;
}

Expand Down

0 comments on commit ef64de3

Please sign in to comment.