Add url to commit shas in admin config
This commit is contained in:
parent
7e11c2fbd4
commit
3d0a0e5111
@ -28,6 +28,7 @@ import ErrorNote from '@/components/ErrorNote';
|
||||
import Spinner from '@/components/Spinner';
|
||||
import WarningNote from '@/components/WarningNote';
|
||||
import { RiSpeedMiniLine } from 'react-icons/ri';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function SiteChecklistClient({
|
||||
// Storage
|
||||
@ -84,6 +85,7 @@ export default function SiteChecklistClient({
|
||||
baseUrl,
|
||||
commitSha,
|
||||
commitMessage,
|
||||
commitUrl,
|
||||
// Connection status
|
||||
databaseError,
|
||||
storageError,
|
||||
@ -664,7 +666,15 @@ export default function SiteChecklistClient({
|
||||
<span className="font-bold">Commit</span>
|
||||
|
||||
{commitSha
|
||||
? <span title={commitMessage}>{commitSha}</span>
|
||||
? commitUrl
|
||||
? <Link
|
||||
title={commitMessage}
|
||||
href={commitUrl}
|
||||
target="_blank"
|
||||
>
|
||||
{commitSha}
|
||||
</Link>
|
||||
: <span title={commitMessage}>{commitSha}</span>
|
||||
: 'Not Found'}
|
||||
</div>
|
||||
</div>}
|
||||
|
||||
@ -14,10 +14,23 @@ export const SITE_TITLE =
|
||||
'Photo Blog';
|
||||
|
||||
// SOURCE
|
||||
export const VERCEL_COMMIT_MESSAGE =
|
||||
const VERCEL_GIT_PROVIDER =
|
||||
process.env.NEXT_PUBLIC_VERCEL_GIT_PROVIDER;
|
||||
const VERCEL_GIT_REPO_OWNER =
|
||||
process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER;
|
||||
const VERCEL_GIT_REPO_SLUG =
|
||||
process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG;
|
||||
const VERCEL_GIT_COMMIT_MESSAGE =
|
||||
process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_MESSAGE;
|
||||
export const VERCEL_COMMIT_SHA =
|
||||
const VERCEL_GIT_COMMIT_SHA =
|
||||
process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
|
||||
const VERCEL_GIT_COMMIT_SHA_SHORT = VERCEL_GIT_COMMIT_SHA
|
||||
? VERCEL_GIT_COMMIT_SHA.slice(0, 7)
|
||||
: undefined;
|
||||
const VERCEL_GIT_COMMIT_URL = VERCEL_GIT_PROVIDER === 'github'
|
||||
// eslint-disable-next-line max-len
|
||||
? `https://github.com/${VERCEL_GIT_REPO_OWNER}/${VERCEL_GIT_REPO_SLUG}/commit/${VERCEL_GIT_COMMIT_SHA}`
|
||||
: undefined;
|
||||
|
||||
const VERCEL_ENV = process.env.NEXT_PUBLIC_VERCEL_ENV;
|
||||
const VERCEL_PRODUCTION_URL = process.env.VERCEL_PROJECT_PRODUCTION_URL;
|
||||
@ -270,8 +283,9 @@ export const CONFIG_CHECKLIST_STATUS = {
|
||||
isOgTextBottomAligned: OG_TEXT_BOTTOM_ALIGNMENT,
|
||||
// MISC
|
||||
baseUrl: BASE_URL,
|
||||
commitSha: VERCEL_COMMIT_SHA ? VERCEL_COMMIT_SHA.slice(0, 7) : undefined,
|
||||
commitMessage: VERCEL_COMMIT_MESSAGE,
|
||||
commitSha: VERCEL_GIT_COMMIT_SHA_SHORT,
|
||||
commitMessage: VERCEL_GIT_COMMIT_MESSAGE,
|
||||
commitUrl: VERCEL_GIT_COMMIT_URL,
|
||||
};
|
||||
|
||||
export type ConfigChecklistStatus = typeof CONFIG_CHECKLIST_STATUS;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user