Skip to content

Commit

Permalink
improved logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Oct 30, 2023
1 parent c32feda commit 7129931
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/github/pullRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ export class PullRequestApi {
if (users || teams) {
const validArray = (array: string[] | undefined): boolean => !!array && array.length > 0;
const reviewersLog = [
validArray(users) ? `Teams: ${JSON.stringify(users)}` : "",
validArray(teams) ? `Users: ${JSON.stringify(teams)}` : "",
].join(" - ");
validArray(users) ? `Teams: ${JSON.stringify(users)}` : undefined,
validArray(teams) ? `Users: ${JSON.stringify(teams)}` : undefined,
]
.filter((e) => !!e)
.join(" - ");

this.logger.info(`Requesting reviews from ${reviewersLog}`);

Expand Down
4 changes: 3 additions & 1 deletion src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class ActionRunner {
private readonly polkadotApi: TeamApi,
private readonly checks: GitHubChecksApi,
private readonly logger: ActionLogger,
) {}
) { }

Check failure on line 44 in src/runner.ts

View workflow job for this annotation

GitHub Actions / lint

Delete `·`

/**
* Fetches the configuration file, parses it and validates it.
Expand Down Expand Up @@ -191,6 +191,8 @@ export class ActionRunner {
finalReport.usersToRequest = concatArraysUniquely(finalReport.usersToRequest, report.usersToRequest);
}

this.logger.debug(`Request data: ${JSON.stringify(finalReport)}`);

let { teamsToRequest, usersToRequest } = finalReport;

/**
Expand Down

0 comments on commit 7129931

Please sign in to comment.