@ -1043,6 +1043,29 @@ class ExecState extends events.EventEmitter {
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
var desc = Object . getOwnPropertyDescriptor ( m , k ) ;
if ( ! desc || ( "get" in desc ? ! m . _ _esModule : desc . writable || desc . configurable ) ) {
desc = { enumerable : true , get : function ( ) { return m [ k ] ; } } ;
}
Object . defineProperty ( o , k2 , desc ) ;
} ) : ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
o [ k2 ] = m [ k ] ;
} ) ) ;
var _ _setModuleDefault = ( this && this . _ _setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
} ) : function ( o , v ) {
o [ "default" ] = v ;
} ) ;
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . prototype . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
var _ _awaiter = ( this && this . _ _awaiter ) || function ( thisArg , _arguments , P , generator ) {
function adopt ( value ) { return value instanceof P ? value : new P ( function ( resolve ) { resolve ( value ) ; } ) ; }
return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
@ -1056,11 +1079,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return ( mod && mod . _ _esModule ) ? mod : { "default" : mod } ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const cache _1 = _ _webpack _require _ _ ( 692 ) ;
const core = _ _importStar ( _ _webpack _require _ _ ( 470 ) ) ;
const saveImpl _1 = _ _importDefault ( _ _webpack _require _ _ ( 471 ) ) ;
const stateProvider _1 = _ _webpack _require _ _ ( 309 ) ;
const utils = _ _importStar ( _ _webpack _require _ _ ( 443 ) ) ;
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
// throw an uncaught exception. Instead of failing this action, just warn.
process . on ( "uncaughtException" , e => utils . logWarning ( e . message ) ) ;
function run ( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
yield ( 0 , saveImpl _1 . default ) ( new stateProvider _1 . NullStateProvider ( ) ) ;
try {
yield ( 0 , saveImpl _1 . default ) ( new stateProvider _1 . NullStateProvider ( ) ) ;
}
catch ( error ) {
const typedError = error ;
if ( typedError . name === cache _1 . ReserveCacheError . name ) {
core . info ( ` Failed to save: ${ typedError . message } ` ) ;
}
else {
utils . logWarning ( error . message ) ;
}
}
} ) ;
}
run ( ) ;
@ -41086,47 +41127,38 @@ const cache = __importStar(__webpack_require__(692));
const core = _ _importStar ( _ _webpack _require _ _ ( 470 ) ) ;
const constants _1 = _ _webpack _require _ _ ( 196 ) ;
const utils = _ _importStar ( _ _webpack _require _ _ ( 443 ) ) ;
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
// throw an uncaught exception. Instead of failing this action, just warn.
process . on ( "uncaughtException" , e => utils . logWarning ( e . message ) ) ;
function saveImpl ( stateProvider ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
try {
if ( ! utils . isCacheFeatureAvailable ( ) ) {
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 ;
}
// If restore has stored a primary key in state, reuse that
// Else re-evaluate from inputs
const primaryKey = stateProvider . getState ( constants _1 . State . CachePrimaryKey ) ||
core . getInput ( constants _1 . Inputs . Key ) ;
if ( ! primaryKey ) {
utils . logWarning ( ` Key is not specified. ` ) ;
return ;
}
// If matched restore key is same as primary key, then do not save cache
// NO-OP in case of SaveOnly action
const restoredKey = stateProvider . getCacheState ( ) ;
if ( utils . isExactKeyMatch ( primaryKey , restoredKey ) ) {
core . info ( ` Cache hit occurred on the primary key ${ primaryKey } , not saving cache. ` ) ;
return ;
}
const cachePaths = utils . getInputAsArray ( constants _1 . Inputs . Path , {
required : true
} ) ;
const cacheId = yield cache . saveCache ( cachePaths , primaryKey , {
uploadChunkSize : utils . getInputAsInt ( constants _1 . Inputs . UploadChunkSize )
} ) ;
if ( cacheId != - 1 ) {
core . info ( ` Cache saved with key: ${ primaryKey } ` ) ;
}
if ( ! utils . isCacheFeatureAvailable ( ) ) {
return ;
}
catch ( error ) {
utils . logWarning ( error . message ) ;
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 ;
}
// If restore has stored a primary key in state, reuse that
// Else re-evaluate from inputs
const primaryKey = stateProvider . getState ( constants _1 . State . CachePrimaryKey ) ||
core . getInput ( constants _1 . Inputs . Key ) ;
if ( ! primaryKey ) {
utils . logWarning ( ` Key is not specified. ` ) ;
return ;
}
// If matched restore key is same as primary key, then do not save cache
// NO-OP in case of SaveOnly action
const restoredKey = stateProvider . getCacheState ( ) ;
if ( utils . isExactKeyMatch ( primaryKey , restoredKey ) ) {
core . info ( ` Cache hit occurred on the primary key ${ primaryKey } , not saving cache. ` ) ;
return ;
}
const cachePaths = utils . getInputAsArray ( constants _1 . Inputs . Path , {
required : true
} ) ;
const cacheId = yield cache . saveCache ( cachePaths , primaryKey , {
uploadChunkSize : utils . getInputAsInt ( constants _1 . Inputs . UploadChunkSize )
} ) ;
if ( cacheId != - 1 ) {
core . info ( ` Cache saved with key: ${ primaryKey } ` ) ;
}
} ) ;
}
@ -47438,12 +47470,10 @@ function saveCache(paths, key, options) {
}
catch ( error ) {
const typedError = error ;
if ( typedError . name === ValidationError . name ) {
if ( typedError . name === ValidationError . name ||
typedError . name === ReserveCacheError . name ) {
throw error ;
}
else if ( typedError . name === ReserveCacheError . name ) {
core . info ( ` Failed to save: ${ typedError . message } ` ) ;
}
else {
core . warning ( ` Failed to save: ${ typedError . message } ` ) ;
}