Skip to content

Commit

Permalink
refactor: centralize GitHub username and update profile URLs
Browse files Browse the repository at this point in the history
- Introduced a new constant for the GitHub username in metadata.
- Updated GitHub profile and repository URLs to dynamically use the new username constant.
- Refactored the fetchGithubRepos function to utilize the centralized username for API calls.
  • Loading branch information
kWAYTV committed Dec 6, 2024
1 parent d0b402b commit b1fb47a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/actions/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Octokit } from '@octokit/rest';

import { env } from '@/env';
import type { Repository } from '@/interfaces/github';
import { githubUsername } from '@/lib/metadata';

export async function fetchGithubRepos() {
try {
Expand All @@ -12,7 +13,7 @@ export async function fetchGithubRepos() {
});

const response = await octokit.repos.listForUser({
username: 'kWAYTV',
username: githubUsername,
sort: 'updated',
per_page: 100
});
Expand Down
5 changes: 3 additions & 2 deletions src/lib/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ export const baseUrl =
? new URL('http://localhost:3000')
: new URL(`https://${process.env.VERCEL_URL!}`);

export const githubProfileUrl = 'https://github.com/kWAYTV';
export const githubRepoUrl = 'https://github.com/kWAYTV/portfolio';
export const githubUsername = 'kWAYTV';
export const githubProfileUrl = `https://github.com/${githubUsername}`;
export const githubRepoUrl = `https://github.com/${githubUsername}/portfolio`;

0 comments on commit b1fb47a

Please sign in to comment.