version-info: return git branch info correctly in cf workers

This commit is contained in:
wukko
2025-06-28 19:06:21 +06:00
parent bd0caac5ba
commit a751f81ea3
2 changed files with 5 additions and 1 deletions

View File

@@ -39,6 +39,10 @@ export const getBranch = async () => {
return process.env.CF_PAGES_BRANCH;
}
if (process.env.WORKERS_CI_BRANCH) {
return process.env.WORKERS_CI_BRANCH;
}
return (await readGit('.git/HEAD'))
?.replace(/^ref: refs\/heads\//, '')
?.trim();