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] =