File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -688,6 +688,12 @@ a:hover {
688688 color : var (--color-accent );
689689}
690690
691+ .site-footer .build-info {
692+ margin-top : 8px ;
693+ font-size : 12px ;
694+ opacity : 0.7 ;
695+ }
696+
691697/* Buttons */
692698.btn {
693699 display : inline-flex;
Original file line number Diff line number Diff line change 11---
2+ import { execSync } from " child_process" ;
3+
24interface Props {
35 title: string ;
46 description? : string ;
@@ -11,6 +13,21 @@ const {
1113 activeNav = " " ,
1214} = Astro .props ;
1315const base = import .meta .env .BASE_URL ;
16+
17+ // Get git commit SHA and build date at build time
18+ let commitSha = " unknown" ;
19+ let buildDate = new Date ().toISOString ().split (" T" )[0 ];
20+ try {
21+ // Use GITHUB_SHA env var in GitHub Actions, fallback to git command locally
22+ const githubSha = process .env .GITHUB_SHA ;
23+ if (githubSha ) {
24+ commitSha = githubSha .substring (0 , 7 );
25+ } else {
26+ commitSha = execSync (" git rev-parse --short HEAD" , { encoding: " utf-8" }).trim ();
27+ }
28+ } catch {
29+ // Fallback if git is not available
30+ }
1431---
1532
1633<!doctype html >
@@ -155,6 +172,13 @@ const base = import.meta.env.BASE_URL;
155172 rel =" noopener" >MIT License</a
156173 >
157174 </p >
175+ <p class =" build-info" >
176+ Built from <a
177+ href ={ ` https://github.com/github/awesome-copilot/commit/${commitSha } ` }
178+ target =" _blank"
179+ rel =" noopener" >{ commitSha } </a
180+ > on { buildDate }
181+ </p >
158182 </div >
159183 </footer >
160184
You can’t perform that action at this time.
0 commit comments