Skip to content

Commit

Permalink
feat: improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Beesley committed Aug 10, 2021
1 parent 0ac7263 commit 4a78b17
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ async function getPullRequests(ok: Octokit): Promise<PullRequestEdges> {
owner,
repo,
});
console.log(res);
console.info(
`Found pull requests: ${JSON.stringify(
res.repository.pullRequests.edges,
null,
2
)}`
);
return res.repository.pullRequests.edges ?? [];
}

Expand All @@ -32,11 +38,13 @@ async function addCommentToPullRequest(
): Promise<void> {
const query = AddCommentToPr.loc!.source!.body;
if (pr?.node?.id && isDependabotPullRequest(pr)) {
const res = await ok.graphql({
console.info(
`Requesting rebase of PR #${pr.node.number} '${pr.node.title}'`
);
await ok.graphql({
query,
pullRequestId: pr.node.id,
});
console.log(res);
}
}

Expand Down

0 comments on commit 4a78b17

Please sign in to comment.