import { prsEmail } from "https://esm.town/v/ramkarthik/prsEmail";
import { reposStaleGithubPRs } from "https://esm.town/v/ramkarthik/reposStaleGithubPRs";
import process from "node:process";
export async function staleGithubPRsEmail() {
let repos = process.env.githubRepos.split(",").filter((r) =>
r.trim()
);
let staleSinceDaysAgo = 3;
let pullRequests = await reposStaleGithubPRs(
repos,
process.env.githubOwner,
process.env.github,
staleSinceDaysAgo,
);
let { html, subject } = prsEmail(
pullRequests,
staleSinceDaysAgo,
);
console.email({ html: html, subject: subject });
}