File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -21,17 +21,15 @@ const main = async () => {
21
21
assertType < string [ ] > ( restoredImages )
22
22
23
23
const imageDetector = new ImageDetector ( )
24
- if ( await imageDetector . checkIfImageHasAdded ( restoredImages ) ) {
25
- core . info ( `Key ${ restoredKey } already exists, not saving cache.` )
26
- return
27
- }
28
24
29
- const imagesToSave = await imageDetector . getImagesShouldSave ( alreadyExistingImages )
30
- if ( imagesToSave . length < 1 ) {
25
+ const existingAndRestoredImages = alreadyExistingImages . concat ( restoredImages )
26
+ const newImages = await imageDetector . getImagesShouldSave ( existingAndRestoredImages )
27
+ if ( newImages . length < 1 ) {
31
28
core . info ( `There is no image to save.` )
32
29
return
33
30
}
34
31
32
+ const imagesToSave = await imageDetector . getImagesShouldSave ( alreadyExistingImages )
35
33
const layerCache = new LayerCache ( imagesToSave )
36
34
layerCache . concurrency = parseInt ( core . getInput ( `concurrency` , { required : true } ) , 10 )
37
35
Original file line number Diff line number Diff line change @@ -17,9 +17,4 @@ export class ImageDetector {
17
17
alreadRegisteredImages . forEach ( image => resultSet . delete ( image ) )
18
18
return Array . from ( resultSet )
19
19
}
20
-
21
- async checkIfImageHasAdded ( restoredImages : string [ ] ) : Promise < boolean > {
22
- const existing = await this . getExistingImages ( )
23
- return JSON . stringify ( restoredImages ) === JSON . stringify ( existing )
24
- }
25
20
}
You can’t perform that action at this time.
0 commit comments