Skip to content

Commit 5332de0

Browse files
committed
Do not assume GitHub Actions provides normal env variables
1 parent 7eff6a3 commit 5332de0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/astro.config.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import starlight from '@astrojs/starlight';
44
import mtasaStarlightThemePlugin from 'starlight-theme-mtasa'
55

66
const isDeploy = process.env.GITHUB_ACTIONS === 'true';
7-
const ownerName = isDeploy ? process.env.GITHUB_REPOSITORY_NAME : undefined;
8-
const siteName = isDeploy ? `https://${process.env.GITHUB_REPOSITORY_OWNER}.github.io` : undefined;
7+
const repositoryName = (isDeploy && process.env.GITHUB_REPOSITORY) ? (process.env.GITHUB_REPOSITORY).split('/')[0] : undefined;
8+
const siteBaseUrl = (isDeploy && process.env.GITHUB_REPOSITORY_OWNER) ? `https://${process.env.GITHUB_REPOSITORY_OWNER}.github.io` : undefined;
99

1010
// https://astro.build/config
1111
export default defineConfig({
12-
site: siteName,
13-
base: ownerName,
12+
site: siteBaseUrl,
13+
base: repositoryName,
1414
integrations: [
1515
starlight({
1616
title: 'Multi Theft Auto: Theme',

0 commit comments

Comments
 (0)