Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
chore: add debugging logs
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Dec 13, 2023
1 parent ee51fb8 commit e23ccee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/handlers/wildcard/unassign/unassign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ type IssuesListEventsResponseData = RestEndpointMethodTypes["issues"]["listEvent

export async function checkTasksToUnassign(context: Context) {
const logger = context.logger;
logger.debug("Checking tasks to unassign");

const issuesAndPullsOpened = await listAllIssuesAndPullsForRepo(context, IssueType.OPEN);

logger.debug("Fetched all issues and pulls opened", { issuesAndPullsOpened });

const assignedIssues = issuesAndPullsOpened.filter((issue) => issue.assignee);

const tasksToUnassign = await Promise.all(
assignedIssues.map(async (assignedIssue: GitHubIssue) => checkTaskToUnassign(context, assignedIssue))
assignedIssues.map((assignedIssue: GitHubIssue) => checkTaskToUnassign(context, assignedIssue))
);

logger.debug("Checked tasks to unassign", { tasksToUnassign });

logger.ok("Checked all the tasks to unassign", {
tasksToUnassign: tasksToUnassign.filter(Boolean).map((task) => task?.metadata),
});
Expand Down

0 comments on commit e23ccee

Please sign in to comment.