Skip to content

Commit

Permalink
hide-credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Avdhesh-Varshney committed Oct 17, 2024
1 parent 6d8db11 commit d35a2b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions webmasterlog/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NEXT_PUBLIC_GITHUB_API_URL="https://api.github.com/repos/Avdhesh-Varshney/WebMasterLog"
NEXT_PUBLIC_GITHUB_MAIN_BRANCH_URL="https://github.com/Avdhesh-Varshney/WebMasterLog/raw/main"
NEXT_PUBLIC_GITHUB_MAIN_BRANCH_RAW_URL="https://raw.githubusercontent.com/Avdhesh-Varshney/WebMasterLog/main"
3 changes: 1 addition & 2 deletions webmasterlog/src/app/contributors/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface Contributor {
}

const Contributors = () => {
const URL = 'https://api.github.com/repos/Avdhesh-Varshney/WebMasterLog/contributors?per_page=500';
const URL = `${process.env.NEXT_PUBLIC_GITHUB_API_URL}/contributors?per_page=500`;
const [contributors, setContributors] = useState<Contributor[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<null | string>(null);
Expand All @@ -52,7 +52,6 @@ const Contributors = () => {

if (loading) return <div>Loading...</div>;
if (error) return <div>Error: {error}</div>;
console.log(contributors[0])

return (
<div className="bg-[#191c24] p-4 rounded-lg my-2">
Expand Down
6 changes: 3 additions & 3 deletions webmasterlog/src/components/shared/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ProjectCard = ({ key, projectDir, projectSubdir, project }: { key: number,
const fetchData = async (project: string) => {
try {
const response = await fetch(
`https://api.github.com/repos/Avdhesh-Varshney/WebMasterLog/commits?path=${projectDir}/${projectSubdir}/${project}&per_page=50`,
`${process.env.NEXT_PUBLIC_GITHUB_API_URL}/commits?path=${projectDir}/${projectSubdir}/${project}&per_page=50`,
{
next: {
revalidate: 86400,
Expand Down Expand Up @@ -49,7 +49,7 @@ const ProjectCard = ({ key, projectDir, projectSubdir, project }: { key: number,
<CardHeader>
<CardTitle className="text-white">{project.replace(/-/g, ' ')}</CardTitle>
<CardDescription>
<Link href={`https://github.com/Avdhesh-Varshney/WebMasterLog/raw/main/${projectDir}/${projectSubdir}/${project}`}>
<Link href={`${process.env.NEXT_PUBLIC_GITHUB_MAIN_BRANCH_URL}/${projectDir}/${projectSubdir}/${project}`}>

Check failure

Code scanning / CodeQL

Stored cross-site scripting High

Stored cross-site scripting vulnerability due to
stored value
.
{`${projectSubdir}/${project}`}
</Link>
</CardDescription>
Expand All @@ -58,7 +58,7 @@ const ProjectCard = ({ key, projectDir, projectSubdir, project }: { key: number,
<CardContent className="flex justify-center items-center">
<div className="relative w-full h-48 group">
<Image
src={`https://raw.githubusercontent.com/Avdhesh-Varshney/WebMasterLog/main/${projectDir}/${projectSubdir}/${project}/screenshot.webp`}
src={`${process.env.NEXT_PUBLIC_GITHUB_MAIN_BRANCH_RAW_URL}/${projectDir}/${projectSubdir}/${project}/screenshot.webp`}
alt={project}
width={300}
height={280}
Expand Down

0 comments on commit d35a2b1

Please sign in to comment.