parent
8d6facd983
commit
39e55a06e8
2 changed files with 35 additions and 0 deletions
@ -0,0 +1,4 @@ |
|||||||
|
import { execSync } from 'child_process'; |
||||||
|
export async function GET() { |
||||||
|
return new Response(JSON.stringify({}), {}); |
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
import { execSync } from 'child_process'; |
||||||
|
|
||||||
|
export async function GET() { |
||||||
|
const commitHash = execSync('git rev-parse HEAD').toString().trim(); |
||||||
|
const commitDate = execSync('git log -1 --format=%cd').toString().trim(); |
||||||
|
const commitMessage = execSync('git log -1 --format=%B').toString().trim(); |
||||||
|
|
||||||
|
const prevCommitHash = execSync('git rev-parse HEAD~1').toString().trim(); |
||||||
|
const prevCommitDate = execSync('git log -1 --format=%cd HEAD~1') |
||||||
|
.toString() |
||||||
|
.trim(); |
||||||
|
const prevCommitMessage = execSync('git log -1 --format=%B HEAD~1') |
||||||
|
.toString() |
||||||
|
.trim(); |
||||||
|
|
||||||
|
return new Response( |
||||||
|
JSON.stringify({ |
||||||
|
current: { |
||||||
|
hash: commitHash, |
||||||
|
date: commitDate, |
||||||
|
message: commitMessage, |
||||||
|
}, |
||||||
|
previous: { |
||||||
|
hash: prevCommitHash, |
||||||
|
date: prevCommitDate, |
||||||
|
message: prevCommitMessage, |
||||||
|
}, |
||||||
|
}), |
||||||
|
{}, |
||||||
|
); |
||||||
|
} |
Loading…
Reference in new issue