@ -4607,7 +4607,9 @@ exports.RefKey = exports.Events = exports.State = exports.Outputs = exports.Inpu
var Inputs ;
var Inputs ;
( function ( Inputs ) {
( function ( Inputs ) {
Inputs [ "Key" ] = "key" ;
Inputs [ "Key" ] = "key" ;
Inputs [ "OnlyRestore" ] = "only-restore" ;
Inputs [ "Path" ] = "path" ;
Inputs [ "Path" ] = "path" ;
Inputs [ "Reeval" ] = "reeval" ;
Inputs [ "RestoreKeys" ] = "restore-keys" ;
Inputs [ "RestoreKeys" ] = "restore-keys" ;
Inputs [ "UploadChunkSize" ] = "upload-chunk-size" ;
Inputs [ "UploadChunkSize" ] = "upload-chunk-size" ;
} ) ( Inputs = exports . Inputs || ( exports . Inputs = { } ) ) ;
} ) ( Inputs = exports . Inputs || ( exports . Inputs = { } ) ) ;
@ -37317,8 +37319,6 @@ function createTar(archiveFolder, sourceDirectories, compressionMethod) {
... getCompressionProgram ( ) ,
... getCompressionProgram ( ) ,
'-cf' ,
'-cf' ,
cacheFileName . replace ( new RegExp ( ` \\ ${ path . sep } ` , 'g' ) , '/' ) ,
cacheFileName . replace ( new RegExp ( ` \\ ${ path . sep } ` , 'g' ) , '/' ) ,
'--exclude' ,
cacheFileName . replace ( new RegExp ( ` \\ ${ path . sep } ` , 'g' ) , '/' ) ,
'-P' ,
'-P' ,
'-C' ,
'-C' ,
workingDirectory . replace ( new RegExp ( ` \\ ${ path . sep } ` , 'g' ) , '/' ) ,
workingDirectory . replace ( new RegExp ( ` \\ ${ path . sep } ` , 'g' ) , '/' ) ,
@ -46770,49 +46770,52 @@ const utils = __importStar(__webpack_require__(443));
process . on ( "uncaughtException" , e => utils . logWarning ( e . message ) ) ;
process . on ( "uncaughtException" , e => utils . logWarning ( e . message ) ) ;
function run ( ) {
function run ( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
try {
const save = ! core . getBooleanInput ( constants _1 . Inputs . OnlyRestore ) ;
if ( ! utils . isCacheFeatureAvailable ( ) ) {
if ( save ) {
return ;
}
if ( ! utils . isValidEvent ( ) ) {
utils . logWarning ( ` Event Validation Error: The event type ${ process . env [ constants _1 . Events . Key ] } is not supported because it's not tied to a branch or tag ref. ` ) ;
return ;
}
const state = utils . getCacheState ( ) ;
// Inputs are re-evaluted before the post action, so we want the original key used for restore
const primaryKey = core . getState ( constants _1 . State . CachePrimaryKey ) ;
if ( ! primaryKey ) {
utils . logWarning ( ` Error retrieving key from state. ` ) ;
return ;
}
if ( utils . isExactKeyMatch ( primaryKey , state ) ) {
core . info ( ` Cache hit occurred on the primary key ${ primaryKey } , not saving cache. ` ) ;
return ;
}
const cachePaths = utils . getInputAsArray ( constants _1 . Inputs . Path , {
required : true
} ) ;
try {
try {
yield cache . saveCache ( cachePaths , primaryKey , {
if ( ! utils . isCacheFeatureAvailable ( ) ) {
uploadChunkSize : utils . getInputAsInt ( constants _1 . Inputs . UploadChunkSize )
return ;
} ) ;
core . info ( ` Cache saved with key: ${ primaryKey } ` ) ;
}
catch ( error ) {
const typedError = error ;
if ( typedError . name === cache . ValidationError . name ) {
throw error ;
}
}
else if ( typedError . name === cache . ReserveCacheError . name ) {
if ( ! utils . isValidEvent ( ) ) {
core . info ( typedError . message ) ;
utils . logWarning ( ` Event Validation Error: The event type ${ process . env [ constants _1 . Events . Key ] } is not supported because it's not tied to a branch or tag ref. ` ) ;
return ;
}
}
else {
const state = utils . getCacheState ( ) ;
utils . logWarning ( typedError . message ) ;
// Inputs are re-evaluted before the post action, so we want the original key used for restore
const primaryKey = core . getState ( constants _1 . State . CachePrimaryKey ) ;
if ( ! primaryKey ) {
utils . logWarning ( ` Error retrieving key from state. ` ) ;
return ;
}
if ( utils . isExactKeyMatch ( primaryKey , state ) ) {
core . info ( ` Cache hit occurred on the primary key ${ primaryKey } , not saving cache. ` ) ;
return ;
}
const cachePaths = utils . getInputAsArray ( constants _1 . Inputs . Path , {
required : true
} ) ;
try {
yield cache . saveCache ( cachePaths , primaryKey , {
uploadChunkSize : utils . getInputAsInt ( constants _1 . Inputs . UploadChunkSize )
} ) ;
core . info ( ` Cache saved with key: ${ primaryKey } ` ) ;
}
catch ( error ) {
const typedError = error ;
if ( typedError . name === cache . ValidationError . name ) {
throw error ;
}
else if ( typedError . name === cache . ReserveCacheError . name ) {
core . info ( typedError . message ) ;
}
else {
utils . logWarning ( typedError . message ) ;
}
}
}
}
}
}
catch ( error ) {
catch ( error ) {
utils . logWarning ( error . message ) ;
utils . logWarning ( error . message ) ;
}
}
}
} ) ;
} ) ;
}
}