mirror of
https://github.com/xHyroM/website.git
synced 2024-11-22 15:01:05 +01:00
build: investigate why fetching doesnt work
This commit is contained in:
parent
7d03f61f03
commit
5adef49cec
1 changed files with 16 additions and 13 deletions
|
@ -92,21 +92,24 @@ const projects: Project[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const project of projects) {
|
for (const project of projects) {
|
||||||
const repository = await (
|
try {
|
||||||
await fetch(`https://api.github.com/repos/${project.link.slice(19)}`, {
|
const repository = await (
|
||||||
headers: {
|
await fetch(`https://api.github.com/repos/${project.link.slice(19)}`, {
|
||||||
Authorization: `Bearer ${import.meta.env.GITHUB_ACCESS_TOKEN}`,
|
headers: {
|
||||||
},
|
Authorization: `Bearer ${import.meta.env.GITHUB_ACCESS_TOKEN}`,
|
||||||
})
|
},
|
||||||
).json();
|
})
|
||||||
|
).json();
|
||||||
|
|
||||||
console.log(import.meta.env);
|
console.log(repository); //debug
|
||||||
console.log(repository); //debug
|
|
||||||
|
|
||||||
project.stats = {
|
project.stats = {
|
||||||
forks: repository.forks,
|
forks: repository.forks,
|
||||||
stars: repository.stargazers_count,
|
stars: repository.stargazers_count,
|
||||||
};
|
};
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
projects.sort((a, b) => a.name.localeCompare(b.name));
|
projects.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
|
|
Loading…
Reference in a new issue