Skip to content

Commit

Permalink
Log more context
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Jul 28, 2020
1 parent 8850f37 commit c4e53fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions dist/pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,23 @@ const { getLogger, getInputs } = util.util;

const logger = getLogger();
const inputs = getInputs(logger);
const context = util.github.context;

logger.debug(() => "Running pre tachometer-reporter-action...");
logger.debug(() => "Report ID: " + JSON.stringify(inputs.reportId));
logger.debug(() => "Context: " + JSON.stringify(util.github.context, null, 2));
logger.debug(() => "Issue: " + JSON.stringify(context.issue, null, 2));
logger.debug(() => "Repo: " + JSON.stringify(context.repo, null, 2));
logger.debug(() => "Context: " + JSON.stringify(context, null, 2));

if (!inputs.reportId) {
return logger.info(
logger.info(
'No reportId provided. Skipping updating comment with "Running..." status.'
);

return;
}

const context = util.github.context;
const octokit = util.github.getOctokit(token);

const report = await reportTachRunning(octokit, context, inputs, logger);

logger.debug(() => "Report: " + JSON.stringify(report, null, 2));
Expand Down
11 changes: 7 additions & 4 deletions src/actions/pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ const { getLogger, getInputs } = require("./util");

const logger = getLogger();
const inputs = getInputs(logger);
const context = github.context;

logger.debug(() => "Running pre tachometer-reporter-action...");
logger.debug(() => "Report ID: " + JSON.stringify(inputs.reportId));
logger.debug(() => "Context: " + JSON.stringify(github.context, null, 2));
logger.debug(() => "Issue: " + JSON.stringify(context.issue, null, 2));
logger.debug(() => "Repo: " + JSON.stringify(context.repo, null, 2));
logger.debug(() => "Context: " + JSON.stringify(context, null, 2));

if (!inputs.reportId) {
return logger.info(
logger.info(
'No reportId provided. Skipping updating comment with "Running..." status.'
);

return;
}

const context = github.context;
const octokit = github.getOctokit(token);

const report = await reportTachRunning(octokit, context, inputs, logger);

logger.debug(() => "Report: " + JSON.stringify(report, null, 2));
Expand Down

0 comments on commit c4e53fb

Please sign in to comment.