File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 - name : Build the docs
4444 run : pnpm build
4545 working-directory : website
46+ env :
47+ NEXT_GHOST_CMS_API_KEY : ${{ secrets.NEXT_GHOST_CMS_API_KEY }}
48+ NEXT_GHOST_CMS_API_URL : ${{ secrets.NEXT_GHOST_CMS_API_URL }}
Original file line number Diff line number Diff line change 11export default async function getPosts ( ) {
22 const API_KEY = process . env . NEXT_GHOST_CMS_API_KEY ;
3+ const API_URL = process . env . NEXT_GHOST_CMS_API_URL ;
4+
5+ if ( ! API_KEY || ! API_URL ) {
6+ if ( ! process . env . VERCEL_ENV ) {
7+ return [ ] ;
8+ }
9+
10+ throw new Error (
11+ `Please set NEXT_GHOST_CMS_API_KEY and NEXT_GHOST_CMS_API_URL environment variables`
12+ ) ;
13+ }
14+
315 const endpoint = `${ process . env . NEXT_GHOST_CMS_CONTENT_URL } /posts?key=${ API_KEY } &filter=tag:[hardhat,hardhat-ignition]` ;
416
517 const response = await fetch ( endpoint ) ;
You can’t perform that action at this time.
0 commit comments