11import * as core from '@actions/core' ;
2- import { getDirInput , Input , Output , restore , State } from './Util' ;
2+ import { getCompressInput , getDirInput , Input , Output , restore , State } from './Util' ;
33
44( async ( ) : Promise < void > => {
55 try {
66 const paths = core . getInput ( Input . Path , { required : true } ) . split ( / \r ? \n / ) . map ( p => p . trim ( ) ) . filter ( p => p . length > 0 ) ;
77 const key = core . getInput ( Input . Key , { required : true } ) ;
88 const dir = getDirInput ( core . getInput ( Input . Dir , { required : false } ) ) ;
9+ const compress = getCompressInput ( core . getInput ( Input . Compress , { required : false } ) ) ;
910
1011 if ( ! paths . length || ! key || ! dir ) {
1112 core . info ( 'Missing inputs, skipping cache restore.' ) ;
@@ -16,8 +17,9 @@ import { getDirInput, Input, Output, restore, State } from './Util';
1617 core . saveState ( State . CacheKey , key ) ;
1718 core . saveState ( State . CacheDir , dir ) ;
1819 core . saveState ( State . CachePaths , JSON . stringify ( paths ) ) ;
20+ core . saveState ( State . CacheCompress , compress . toString ( ) ) ;
1921
20- const isRestored = await restore ( paths , key , dir ) ;
22+ const isRestored = await restore ( paths , key , dir , compress ) ;
2123 core . setOutput ( Output . CacheHit , isRestored . toString ( ) ) ;
2224
2325 if ( isRestored ) {
0 commit comments