mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-11 18:45:41 +00:00
Added github username env variable
This commit is contained in:
parent
99d70b1d98
commit
e3d378ccdc
@ -5,3 +5,4 @@ NEXT_PUBLIC_SITE_URL=https://example.com
|
||||
DATABASE_URL=
|
||||
SHADOW_DATABASE_URL=
|
||||
GITHUB_ACCESS_TOKEN=
|
||||
GITHUB_USERNAME=
|
@ -2,6 +2,7 @@ import type {Repo} from '@/types'
|
||||
import fetcher from "@/lib/fetcher";
|
||||
|
||||
const GITHUB_ACCESS_TOKEN = process.env.GITHUB_ACCESS_TOKEN
|
||||
const GITHUB_USERNAME = process.env.GITHUB_USERNAME
|
||||
const GITHUB_GRAPHQL = "https://api.github.com/graphql"
|
||||
|
||||
type PinnedReposResponse = {
|
||||
@ -59,7 +60,7 @@ export async function getPinnedRepos() {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: `{
|
||||
user(login: "r-freeman") {
|
||||
user(login: "${GITHUB_USERNAME}") {
|
||||
pinnedItems(first: 6, types: REPOSITORY) {
|
||||
nodes {
|
||||
... on Repository {
|
||||
@ -92,7 +93,7 @@ export async function getTotalRepos() {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: `{
|
||||
user(login: "r-freeman") {
|
||||
user(login: "${GITHUB_USERNAME}") {
|
||||
repositories {
|
||||
totalCount
|
||||
}
|
||||
@ -113,7 +114,7 @@ export async function getTotalFollowers() {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: `{
|
||||
user(login: "r-freeman") {
|
||||
user(login: "${GITHUB_USERNAME}") {
|
||||
followers {
|
||||
totalCount
|
||||
}
|
||||
@ -134,7 +135,7 @@ export async function getTotalStars(totalRepos: number) {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: `{
|
||||
user(login: "r-freeman") {
|
||||
user(login: "${GITHUB_USERNAME}") {
|
||||
repositories(first: ${totalRepos}) {
|
||||
nodes {
|
||||
stargazers {
|
||||
|
Loading…
Reference in New Issue
Block a user