@@ -136,32 +136,32 @@ class LayerCache {
136136 async restore ( key : string , restoreKeys ?: string [ ] ) {
137137 this . originalKeyToStore = key
138138 // const restoreKeysIncludedRootKey = [key, ...(restoreKeys !== undefined ? restoreKeys : [])]
139- const hasRestoredRootCache = await this . restoreRoot ( restoreKeys )
140- if ( ! hasRestoredRootCache ) {
139+ const restoredCacheKey = await this . restoreRoot ( restoreKeys )
140+ if ( restoredCacheKey === undefined ) {
141141 core . info ( `Root cache could not be found. aborting.` )
142- return false
142+ return undefined
143143 }
144144 if ( this . enabledParallel ) {
145145 const hasRestoredAllLayers = await this . restoreLayers ( )
146146 if ( ! hasRestoredAllLayers ) {
147147 core . info ( `Some layer cache could not be found. aborting.` )
148- return false
148+ return undefined
149149 }
150150 await this . joinAllLayerCaches ( )
151151 }
152152 await this . loadImageFromUnpacked ( )
153- return true
153+ return restoredCacheKey
154154 }
155155
156- private async restoreRoot ( restoreKeys ?: string [ ] ) : Promise < boolean > {
156+ private async restoreRoot ( restoreKeys ?: string [ ] ) : Promise < string | undefined > {
157157 core . debug ( `Trying to restore root cache, ID: ${ this . getRootKey ( ) } , dir: ${ this . getUnpackedTarDir ( ) } ` )
158158 const restoredCacheKeyMayUndefined = await cache . restoreCache ( [ this . getUnpackedTarDir ( ) ] , this . getRootKey ( ) , restoreKeys )
159159 core . debug ( `restoredCacheKeyMayUndefined: ${ restoredCacheKeyMayUndefined } ` )
160160 if ( restoredCacheKeyMayUndefined === undefined ) {
161- return false
161+ return undefined
162162 }
163163 this . originalKeyToStore = restoredCacheKeyMayUndefined . replace ( / - r o o t $ / , '' )
164- return true
164+ return this . originalKeyToStore
165165 }
166166
167167 private async restoreLayers ( ) {
0 commit comments