File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,12 @@ async function run() {
36
36
const registryName = await getRegistryName ( ) ;
37
37
const packages = await getPackages ( ) ;
38
38
39
- try {
40
- await cleanRegistry ( registryName , packages ) ;
41
- } catch ( e ) {
42
- core . info ( `[warning] ${ ( e as any ) . stack } ` ) ;
39
+ if ( registryName ) {
40
+ try {
41
+ await cleanRegistry ( registryName , packages ) ;
42
+ } catch ( e ) {
43
+ core . info ( `[warning] ${ ( e as any ) . stack } ` ) ;
44
+ }
43
45
}
44
46
45
47
try {
@@ -71,14 +73,17 @@ async function run() {
71
73
72
74
run ( ) ;
73
75
74
- async function getRegistryName ( ) : Promise < string > {
76
+ async function getRegistryName ( ) : Promise < string | null > {
75
77
const globber = await glob . create ( `${ paths . index } /**/.last-updated` , { followSymbolicLinks : false } ) ;
76
78
const files = await globber . glob ( ) ;
77
79
if ( files . length > 1 ) {
78
80
core . warning ( `got multiple registries: "${ files . join ( '", "' ) } "` ) ;
79
81
}
80
82
81
83
const first = files . shift ( ) ! ;
84
+ if ( ! first ) {
85
+ return null ;
86
+ }
82
87
return path . basename ( path . dirname ( first ) ) ;
83
88
}
84
89
You can’t perform that action at this time.
0 commit comments