Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions scripts/preview-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,25 @@ import { getGithubToken, getRepoInfo } from "./helpers.js";
// 5) VERCEL_URL (commit URL)
// 6) Fallback to fork production domain
const BASE_URL = (() => {
let URL = "";
if (process.env.BASE_URL) {
return process.env.BASE_URL;
URL = process.env.BASE_URL;
}
if (process.env.VERCEL_ENV === "production" && process.env.VERCEL_URL) {
return `https://${process.env.VERCEL_URL}`;
URL = `https://${process.env.VERCEL_URL}`;
}
if (process.env.VERCEL_BRANCH_URL) {
return `https://${process.env.VERCEL_BRANCH_URL}`;
URL = `https://${process.env.VERCEL_BRANCH_URL}`;
}
if (process.env.VERCEL_PREVIEW_URL) {
return process.env.VERCEL_PREVIEW_URL;
URL = process.env.VERCEL_PREVIEW_URL;
}
if (process.env.VERCEL_URL) {
return `https://${process.env.VERCEL_URL}`;
URL = `https://${process.env.VERCEL_URL}`;
}
return "https://github-readme-stats-plus-theta.vercel.app";
URL = "https://github-readme-stats-plus-theta.vercel.app";
console.log(`Using URL: ${URL}`);
return URL;
})();

const COMMENTER = "github-actions[bot]";
Expand Down
Loading