Add backend commit message

This commit is contained in:
MartinBraquet
2025-12-15 13:45:07 +02:00
parent 704bcb4619
commit ed094bbeca
4 changed files with 11 additions and 5 deletions

View File

@@ -27,13 +27,16 @@ SERVICE_NAME="api"
GIT_REVISION=$(git rev-parse --short HEAD)
GIT_COMMIT_DATE=$(git log -1 --format=%ci)
GIT_COMMIT_AUTHOR=$(git log -1 --format='%an')
GIT_COMMIT_MESSAGE=$(git log -1 --format='%s')
echo "Git commit message: ${GIT_COMMIT_MESSAGE}"
cat > metadata.json << EOF
{
"git": {
"revision": "${GIT_REVISION}",
"commitDate": "${GIT_COMMIT_DATE}",
"author": "${GIT_COMMIT_AUTHOR}"
"author": "${GIT_COMMIT_AUTHOR}",
"message": "${GIT_COMMIT_MESSAGE}"
}
}
EOF

View File

@@ -1,7 +1,8 @@
{
"git": {
"revision": "91f69ed",
"commitDate": "2025-12-04 20:51:09+0100",
"author": "MartinBraquet"
"revision": "704bcb4",
"commitDate": "2025-12-15 13:38:09 +0200",
"author": "MartinBraquet",
"message": "Increase API docs font size on mobile"
}
}

View File

@@ -1,7 +1,7 @@
{
"name": "@compass/api",
"description": "Backend API endpoints",
"version": "1.0.13",
"version": "1.0.14",
"private": true,
"scripts": {
"watch:serve": "tsx watch src/serve.ts",

View File

@@ -87,11 +87,13 @@ const BackendInfo = () => {
const gitInfo = info.git || {}
const sha = gitInfo.revision
const commitDate = gitInfo.commitDate
const commitMessage = gitInfo.message
const url = `${githubRepo}/commit/${sha}`
return <Col>
<h3>Backend</h3>
<p>API version: {info.version}</p>
{sha && <p>API commit SHA: <CustomLink href={url}>{sha}</CustomLink></p>}
{commitMessage && <p>API commit message: {commitMessage}</p>}
{commitDate && <p>API commit date: {commitDate}</p>}
</Col>
}