Skip to content

Commit

Permalink
Add CI excpetion
Browse files Browse the repository at this point in the history
  • Loading branch information
HazAT committed Feb 25, 2024
1 parent 7e7b17f commit 31dd0be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/changelog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import {MDXRemote} from 'next-mdx-remote/rsc';
import Article from 'sentry-docs/components/changelog/article';
import {mdxOptions} from 'sentry-docs/mdxOptions';

// We need this here so it's not prerendered during build
export const dynamic = 'force-dynamic';

type ChangelogWithCategories = Changelog & {
categories: Category[];
};
Expand Down Expand Up @@ -43,6 +40,10 @@ export async function generateMetadata(
}

const getChangelog = async slug => {
// If CI we return nothing so prerendering doesn't error when calling an internal route
if (process.env.CI) {
return null;
}
const result = await fetch(
`${process.env.BASE_URL || `https://${process.env.VERCEL_URL}` || 'https://localhost:3000'}/changelog/${slug}/api`
);
Expand Down
7 changes: 4 additions & 3 deletions app/changelog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import List from 'sentry-docs/components/changelog/list';

import Header from './header';

// We need this here so it's not prerendered during build
export const dynamic = 'force-dynamic';

const getChangelogs = async () => {
// If CI we return nothing so prerendering doesn't error when calling an internal route
if (process.env.CI) {
return [];
}
const result = await fetch(
`${process.env.BASE_URL || `https://${process.env.VERCEL_URL}` || 'https://localhost:3000'}/changelog/api`,
{
Expand Down

0 comments on commit 31dd0be

Please sign in to comment.