Skip to content

Commit

Permalink
feat: use util.inspect instead of JSON.stringify for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
rauno56 committed Jan 4, 2022
1 parent d3aebc9 commit a986d0e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { strict as assert } from 'assert';
import * as util from 'util';

import * as core from '@actions/core';
import * as github from '@actions/github';
import { validateConfig } from './models/config';
Expand Down Expand Up @@ -37,7 +39,7 @@ async function main() {
issue_number: github.context.issue.number,
assignees: owners,
});
core.debug(JSON.stringify(addAssigneesResult));
core.debug(util.inspect(addAssigneesResult));
}


Expand Down Expand Up @@ -74,14 +76,14 @@ async function main() {
// Ignore the case when the owner is not a collaborator.
// Happens in forks and when the user hasn't yet received a write bit on the repo.
assert(err.message?.includes?.('Reviews may only be requested from collaborators'), err);
core.info(`Ignoring error: ${err.toString()}`);
core.info(`Ignoring error: ${util.inspect(err)}`);
return err;
});
core.debug(JSON.stringify(requestReviewersResult));
core.debug(util.inspect(requestReviewersResult));
}
}

main().catch(err => {
core.debug(err.toString());
core.debug(util.inspect(err));
core.setFailed(err.message);
});

0 comments on commit a986d0e

Please sign in to comment.