Skip to content

Commit

Permalink
Better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz committed Jan 1, 2024
1 parent bf995d8 commit fa10488
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140528,7 +140528,7 @@ function generateJobSummary(buildResults, cacheListener) {
const summaryTable = renderSummaryTable(buildResults);
const cachingReport = (0, cache_reporting_1.generateCachingReport)(cacheListener);
if (shouldGenerateJobSummary()) {
core.info('Adding Job Summary as PR comment.');
core.info('Generating Job Summary');
core.summary.addRaw(summaryTable);
core.summary.addRaw(cachingReport);
yield core.summary.write();
Expand Down Expand Up @@ -140557,8 +140557,8 @@ function addPRComment(content) {
core.info(`Context payload: ${JSON.stringify(context.payload)}`);
return;
}
core.info('Adding Job Summary as PR comment.');
const pull_request_number = context.payload.pull_request.number;
core.info(`Adding Job Summary as comment to PR #${pull_request_number}.`);
const octokit = github.getOctokit(github_token);
yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, context.repo), { issue_number: pull_request_number, body: content }));
}
Expand Down
2 changes: 1 addition & 1 deletion dist/main/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137849,7 +137849,7 @@ function generateJobSummary(buildResults, cacheListener) {
const summaryTable = renderSummaryTable(buildResults);
const cachingReport = (0, cache_reporting_1.generateCachingReport)(cacheListener);
if (shouldGenerateJobSummary()) {
core.info('Adding Job Summary as PR comment.');
core.info('Generating Job Summary');
core.summary.addRaw(summaryTable);
core.summary.addRaw(cachingReport);
yield core.summary.write();
Expand Down Expand Up @@ -137878,8 +137878,8 @@ function addPRComment(content) {
core.info(`Context payload: ${JSON.stringify(context.payload)}`);
return;
}
core.info('Adding Job Summary as PR comment.');
const pull_request_number = context.payload.pull_request.number;
core.info(`Adding Job Summary as comment to PR #${pull_request_number}.`);
const octokit = github.getOctokit(github_token);
yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, context.repo), { issue_number: pull_request_number, body: content }));
}
Expand Down
2 changes: 1 addition & 1 deletion dist/post/index.js.map

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions src/job-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function generateJobSummary(buildResults: BuildResult[], cacheListe
const cachingReport = generateCachingReport(cacheListener)

if (shouldGenerateJobSummary()) {
core.info('Adding Job Summary as PR comment.')
core.info('Generating Job Summary')

core.summary.addRaw(summaryTable)
core.summary.addRaw(cachingReport)
Expand Down Expand Up @@ -41,11 +41,10 @@ async function addPRComment(content: string): Promise<void> {
return
}

core.info('Adding Job Summary as PR comment.')

const pull_request_number = context.payload.pull_request.number
const octokit = github.getOctokit(github_token)
core.info(`Adding Job Summary as comment to PR #${pull_request_number}.`)

const octokit = github.getOctokit(github_token)
await octokit.rest.issues.createComment({
...context.repo,
issue_number: pull_request_number,
Expand Down

0 comments on commit fa10488

Please sign in to comment.