File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,40 +7,5 @@ type PackageJson = {
77
88const { name, version } = pkg as PackageJson ;
99
10- const envVersion = resolveEnvVersion ( ) ;
11-
1210export const PACKAGE_NAME = name ;
13- export const VERSION = envVersion ?? version ;
14-
15- function resolveEnvVersion ( ) : string | null {
16- const env = process . env ;
17- const direct = env [ "BEE_VERSION" ] ;
18- if ( direct && direct . trim ( ) . length > 0 ) {
19- return sanitizeTag ( direct ) ;
20- }
21-
22- if ( env [ "GITHUB_REF_TYPE" ] === "tag" && env [ "GITHUB_REF_NAME" ] ) {
23- return sanitizeTag ( env [ "GITHUB_REF_NAME" ] ) ;
24- }
25-
26- if ( env [ "GITHUB_REF" ] ) {
27- const match = env [ "GITHUB_REF" ] . match ( / r e f s \/ t a g s \/ ( .+ ) $ / ) ;
28- if ( match && match [ 1 ] ) {
29- return sanitizeTag ( match [ 1 ] ) ;
30- }
31- }
32-
33- if ( env [ "GITHUB_REF_NAME" ] && env [ "GITHUB_REF_NAME" ] . startsWith ( "v" ) ) {
34- return sanitizeTag ( env [ "GITHUB_REF_NAME" ] ) ;
35- }
36-
37- return null ;
38- }
39-
40- function sanitizeTag ( tag : string ) : string {
41- const trimmed = tag . trim ( ) ;
42- if ( trimmed . startsWith ( "v" ) && trimmed . length > 1 ) {
43- return trimmed . slice ( 1 ) ;
44- }
45- return trimmed ;
46- }
11+ export const VERSION = version ;
You can’t perform that action at this time.
0 commit comments