From afefc36031e1cb42d2ca2ee970659e047f9c0081 Mon Sep 17 00:00:00 2001 From: luke-hagar-sp <98849695+luke-hagar-sp@users.noreply.github.com> Date: Thu, 29 Feb 2024 17:54:06 -0500 Subject: [PATCH] Update index.ts --- src/index.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index f0d316a..64813c2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -300,10 +300,6 @@ try { const token = process.env["GITHUB_TOKEN"]; if (!token) throw new Error("GITHUB_TOKEN is not present"); - const username = core.getInput("username") || "lukehagar"; - - if (!username) throw new Error("Username is not present"); - const octokit = new ThrottledOctokit({ auth: token, throttle: { @@ -332,8 +328,8 @@ try { const fetchedAt = Date.now(); - const userDetails = await octokit.rest.users.getByUsername({ username }); - + const userDetails = await octokit.rest.users.getAuthenticated(); + const username = userDetails.data.login; const [userData, repoData, totalCommits, contributionsCollection] = await Promise.all([ getUserData(octokit, username),