One Netlify function to handle individual tokens

This commit is contained in:
Taevas 2025-02-28 22:59:07 +01:00
parent f0742ee107
commit 2363d42c15
7 changed files with 105 additions and 143 deletions

View file

@ -6,8 +6,8 @@ const handler: Handler = async () => {
const octokit = new Octokit({auth: process.env.API_GITHUB});
const github = await octokit.rest.activity.listEventsForAuthenticatedUser({username: "TTTaevas"});
const publicPush = github.data.find((e) => e.type === "PushEvent" && e.public);
const privatePush = github.data.find((e) => e.type === "PushEvent" && !e.public);
const publicPush = github.data.find((e) => (e.type === "PushEvent" || e.type === "PullRequestEvent") && e.public);
const privatePush = github.data.find((e) => (e.type === "PushEvent" || e.type === "PullRequestEvent") && !e.public);
const info: GithubInfo = {
public: publicPush ? {