get sha of current commit
This commit is contained in:
parent
9923513e80
commit
950dee968c
2 changed files with 13 additions and 2 deletions
13
index.js
13
index.js
|
@ -51,7 +51,18 @@ app.locals.siteMap = [
|
||||||
link: "about",
|
link: "about",
|
||||||
description: "who runs abtmtr.link?"
|
description: "who runs abtmtr.link?"
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
|
app.locals.curCommit = "0000000000";
|
||||||
|
|
||||||
|
async function getCurCommit() {
|
||||||
|
const curCommit = await fetch("https://git.abtmtr.link/api/v1/repos/MeowcaTheoRange/abtmtr-v13/branches/main")
|
||||||
|
.catch(() => res.status(500).send())
|
||||||
|
.then((res) => res.json());
|
||||||
|
|
||||||
|
app.locals.curCommit = curCommit.commit.id.substr(0, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
getCurCommit();
|
||||||
|
|
||||||
app.get('/', async (req, res) => {
|
app.get('/', async (req, res) => {
|
||||||
const statusesJson = await fetch("https://cdn.abtmtr.link/site_content/v13/statuses.json")
|
const statusesJson = await fetch("https://cdn.abtmtr.link/site_content/v13/statuses.json")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<footer>
|
<footer>
|
||||||
<h1>abtmtr.link v13-2</h1>
|
<h1>abtmtr.link v13-2 (c. <%= curCommit %>)</h1>
|
||||||
<p>(c) MeowcaTheoRange 2023-24</p>
|
<p>(c) MeowcaTheoRange 2023-24</p>
|
||||||
<p>
|
<p>
|
||||||
licensed under the <a href="https://git.abtmtr.link/MeowcaTheoRange/KarkatPublicLicense/">KKPL</a>.<br />
|
licensed under the <a href="https://git.abtmtr.link/MeowcaTheoRange/KarkatPublicLicense/">KKPL</a>.<br />
|
||||||
|
|
Loading…
Reference in a new issue