Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
yathomasi committed Jul 23, 2024
1 parent ae5aef9 commit c321b1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const siteMetadata = {

const plugins = [
'gatsby-plugin-eslint',
'gatsby-plugin-sharp',
{
resolve: 'gatsby-source-filesystem',
options: {
Expand Down
16 changes: 11 additions & 5 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,18 @@ exports.createResolvers = async ({ createResolvers }) => {
staticGithubData: {
type: 'StaticGithubData',
async resolve() {
const { GITHUB_TOKEN } = process.env
if (GITHUB_TOKEN) {
const stars = await getStars({ owner: 'iterative', repo: 'mlem' })
return { stars }
const staticStar = 719
try {
const { GITHUB_TOKEN } = process.env
if (GITHUB_TOKEN) {
const stars = await getStars({ owner: 'iterative', repo: 'mlem' })
return { stars }
}
return { stars: staticStar }
} catch (error) {
console.error(error)
return { stars: staticStar }
}
return { stars: 719 }
}
}
}
Expand Down

1 comment on commit c321b1c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link Check Report

There were no links to check!

Please sign in to comment.