Skip to content

Commit a751f81

Browse files
committed
version-info: return git branch info correctly in cf workers
1 parent bd0caac commit a751f81

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/version-info/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export const getBranch = async () => {
3939
return process.env.CF_PAGES_BRANCH;
4040
}
4141

42+
if (process.env.WORKERS_CI_BRANCH) {
43+
return process.env.WORKERS_CI_BRANCH;
44+
}
45+
4246
return (await readGit('.git/HEAD'))
4347
?.replace(/^ref: refs\/heads\//, '')
4448
?.trim();

packages/version-info/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@imput/version-info",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "helper package for cobalt that provides commit info & version from package file.",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)