mirror of
https://github.com/xHyroM/website.git
synced 2024-11-22 06:51:05 +01:00
build: investigate why fetching doesnt work
fixed probably
This commit is contained in:
parent
5adef49cec
commit
c7058b83c8
1 changed files with 15 additions and 6 deletions
|
@ -41,7 +41,7 @@ const projects: Project[] = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "setup-bun",
|
name: "setup-bun",
|
||||||
link: "https://github.com/xHyroM/setup-bun",
|
link: "https://github.com/oven-sh/setup-bun",
|
||||||
desc: "Set up your GitHub Actions workflow with a specific version of Bun.",
|
desc: "Set up your GitHub Actions workflow with a specific version of Bun.",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -93,15 +93,24 @@ const projects: Project[] = [
|
||||||
|
|
||||||
for (const project of projects) {
|
for (const project of projects) {
|
||||||
try {
|
try {
|
||||||
const repository = await (
|
const rawRepository = await fetch(
|
||||||
await fetch(`https://api.github.com/repos/${project.link.slice(19)}`, {
|
`https://api.github.com/repos/${project.link.slice(19)}`,
|
||||||
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${import.meta.env.GITHUB_ACCESS_TOKEN}`,
|
Authorization: `Bearer ${import.meta.env.GITHUB_ACCESS_TOKEN}`,
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
).json();
|
).catch(console.log);
|
||||||
|
if (!rawRepository) {
|
||||||
|
project.stats = {
|
||||||
|
forks: 0,
|
||||||
|
stars: 0,
|
||||||
|
};
|
||||||
|
|
||||||
console.log(repository); //debug
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const repository = await rawRepository.json();
|
||||||
|
|
||||||
project.stats = {
|
project.stats = {
|
||||||
forks: repository.forks,
|
forks: repository.forks,
|
||||||
|
|
Loading…
Reference in a new issue