From 68463d649c88eb346fdd57e6aa1862c6c3ca98a9 Mon Sep 17 00:00:00 2001 From: luke-hagar-sp <98849695+luke-hagar-sp@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:10:17 -0500 Subject: [PATCH] pushing username changes --- .github/workflows/test.yaml | 2 ++ src/index.ts | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5d71da4..34e0dc3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,6 +8,8 @@ jobs: - uses: actions/checkout@v3 - uses: ./ + with: + username: lukehagar env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # with: diff --git a/src/index.ts b/src/index.ts index 47df76e..10febfa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -258,12 +258,15 @@ try { const token = process.env["GITHUB_TOKEN"]; if (!token) throw new Error("GITHUB_TOKEN is not present"); + const username = core.getInput("username"); + + if (!username) throw new Error("Username is not present"); + const octokit = new Octokit({ auth: token }); const fetchedAt = Date.now(); - const userDetails = await octokit.rest.users.getAuthenticated(); - const username = userDetails.data.login; + const userDetails = await octokit.rest.users.getByUsername({ username }); const accountCreationDate = userDetails.data.created_at; const [graphQLData, totalCommits, contributionsCollection] =