File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,13 @@ class LayerCache {
3535 await this . separateAllLayerCaches ( )
3636 }
3737
38- return await Promise . all ( [ this . storeRoot ( ) , ...( this . enabledParallel ? await this . storeLayers ( ) : [ ] ) ] )
38+ if ( await this . storeRoot ( ) === undefined ) {
39+ core . info ( `cache key already exists, aborting.` )
40+ return false
41+ }
42+
43+ await Promise . all ( this . enabledParallel ? await this . storeLayers ( ) : [ ] )
44+ return true
3945 }
4046
4147 private async saveImageAsUnpacked ( ) {
@@ -71,7 +77,7 @@ class LayerCache {
7177 core . info ( `Start storing root cache, key: ${ rootKey } , dir: ${ this . getUnpackedTarDir ( ) } ` )
7278 const cacheId = await LayerCache . dismissCacheAlreadyExistsError ( cache . saveCache ( paths , rootKey ) )
7379 core . info ( `Stored root cache, key: ${ rootKey } , id: ${ cacheId } ` )
74- return cacheId
80+ return cacheId !== - 1 ? cacheId : undefined
7581 }
7682
7783 private async separateAllLayerCaches ( ) {
You can’t perform that action at this time.
0 commit comments