feat: show commit SHA in footer with link to repo commit
Build & Push Portfolio Image / build-push (push) Successful in 2m42s
Build & Push Portfolio Image / build-push (push) Successful in 2m42s
This commit is contained in:
@@ -140,6 +140,16 @@ export default function Home() {
|
||||
{t.footer.email}
|
||||
</a>
|
||||
</p>
|
||||
<p className="mt-2 font-mono text-xs text-gray-400 dark:text-gray-500">
|
||||
<a
|
||||
href={`https://forgejo.riotpiao.com/rock/riotpiao.com/commit/${process.env.NEXT_PUBLIC_COMMIT_SHA}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="hover:text-blue-600 dark:hover:text-blue-400"
|
||||
>
|
||||
{process.env.NEXT_PUBLIC_COMMIT_SHA}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
+8
-1
@@ -1,7 +1,14 @@
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
const commitSha = process.env.COMMIT_SHA
|
||||
|| (() => { try { return execSync('git rev-parse --short HEAD').toString().trim(); } catch { return 'dev'; } })();
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
output: 'standalone',
|
||||
env: {
|
||||
NEXT_PUBLIC_COMMIT_SHA: commitSha,
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
// trigger ci 2026年 8月31日 星期一 17时28分38秒 PDT
|
||||
|
||||
Reference in New Issue
Block a user