@ -5460,32 +5460,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
/***/ ( function ( _ _unusedmodule , exports ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . RefKey = exports . Events = exports . State = exports . Outputs = exports . Inputs = void 0 ;
var Inputs ;
( function ( Inputs ) {
Inputs [ "Key" ] = "key" ;
Inputs [ "Path" ] = "path" ;
Inputs [ "RestoreKeys" ] = "restore-keys" ;
Inputs [ "UploadChunkSize" ] = "upload-chunk-size" ;
} ) ( Inputs = exports . Inputs || ( exports . Inputs = { } ) ) ;
var Outputs ;
( function ( Outputs ) {
Outputs [ "CacheHit" ] = "cache-hit" ;
} ) ( Outputs = exports . Outputs || ( exports . Outputs = { } ) ) ;
var State ;
( function ( State ) {
State [ "CachePrimaryKey" ] = "CACHE_KEY" ;
State [ "CacheMatchedKey" ] = "CACHE_RESULT" ;
} ) ( State = exports . State || ( exports . State = { } ) ) ;
var Events ;
( function ( Events ) {
Events [ "Key" ] = "GITHUB_EVENT_NAME" ;
Events [ "Push" ] = "push" ;
Events [ "PullRequest" ] = "pull_request" ;
} ) ( Events = exports . Events || ( exports . Events = { } ) ) ;
exports . RefKey = "GITHUB_REF" ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . RefKey = exports . Events = exports . State = exports . Outputs = exports . Inputs = void 0 ;
var Inputs ;
( function ( Inputs ) {
Inputs [ "Key" ] = "key" ;
Inputs [ "Path" ] = "path" ;
Inputs [ "RestoreKeys" ] = "restore-keys" ;
Inputs [ "UploadChunkSize" ] = "upload-chunk-size" ;
} ) ( Inputs = exports . Inputs || ( exports . Inputs = { } ) ) ;
var Outputs ;
( function ( Outputs ) {
Outputs [ "CacheHit" ] = "cache-hit" ;
} ) ( Outputs = exports . Outputs || ( exports . Outputs = { } ) ) ;
var State ;
( function ( State ) {
State [ "CachePrimaryKey" ] = "CACHE_KEY" ;
State [ "CacheMatchedKey" ] = "CACHE_RESULT" ;
} ) ( State = exports . State || ( exports . State = { } ) ) ;
var Events ;
( function ( Events ) {
Events [ "Key" ] = "GITHUB_EVENT_NAME" ;
Events [ "Push" ] = "push" ;
Events [ "PullRequest" ] = "pull_request" ;
} ) ( Events = exports . Events || ( exports . Events = { } ) ) ;
exports . RefKey = "GITHUB_REF" ;
/***/ } ) ,
@ -38691,92 +38691,92 @@ exports.default = {
/***/ ( function ( _ _unusedmodule , exports , _ _webpack _require _ _ ) {
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( 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 . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . getInputAsInt = exports . getInputAsArray = exports . isValidEvent = exports . logWarning = exports . getCacheState = exports . setOutputAndState = exports . setCacheHitOutput = exports . setCacheState = exports . isExactKeyMatch = exports . isGhes = void 0 ;
const core = _ _importStar ( _ _webpack _require _ _ ( 470 ) ) ;
const constants _1 = _ _webpack _require _ _ ( 196 ) ;
function isGhes ( ) {
const ghUrl = new URL ( process . env [ "GITHUB_SERVER_URL" ] || "https://github.com" ) ;
return ghUrl . hostname . toUpperCase ( ) !== "GITHUB.COM" ;
}
exports . isGhes = isGhes ;
function isExactKeyMatch ( key , cacheKey ) {
return ! ! ( cacheKey &&
cacheKey . localeCompare ( key , undefined , {
sensitivity : "accent"
} ) === 0 ) ;
}
exports . isExactKeyMatch = isExactKeyMatch ;
function setCacheState ( state ) {
core . saveState ( constants _1 . State . CacheMatchedKey , state ) ;
}
exports . setCacheState = setCacheState ;
function setCacheHitOutput ( isCacheHit ) {
core . setOutput ( constants _1 . Outputs . CacheHit , isCacheHit . toString ( ) ) ;
}
exports . setCacheHitOutput = setCacheHitOutput ;
function setOutputAndState ( key , cacheKey ) {
setCacheHitOutput ( isExactKeyMatch ( key , cacheKey ) ) ;
// Store the matched cache key if it exists
cacheKey && setCacheState ( cacheKey ) ;
}
exports . setOutputAndState = setOutputAndState ;
function getCacheState ( ) {
const cacheKey = core . getState ( constants _1 . State . CacheMatchedKey ) ;
if ( cacheKey ) {
core . debug ( ` Cache state/key: ${ cacheKey } ` ) ;
return cacheKey ;
}
return undefined ;
}
exports . getCacheState = getCacheState ;
function logWarning ( message ) {
const warningPrefix = "[warning]" ;
core . info ( ` ${ warningPrefix } ${ message } ` ) ;
}
exports . logWarning = logWarning ;
// Cache token authorized for all events that are tied to a ref
// See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context
function isValidEvent ( ) {
return constants _1 . RefKey in process . env && Boolean ( process . env [ constants _1 . RefKey ] ) ;
}
exports . isValidEvent = isValidEvent ;
function getInputAsArray ( name , options ) {
return core
. getInput ( name , options )
. split ( "\n" )
. map ( s => s . trim ( ) )
. filter ( x => x !== "" ) ;
}
exports . getInputAsArray = getInputAsArray ;
function getInputAsInt ( name , options ) {
const value = parseInt ( core . getInput ( name , options ) ) ;
if ( isNaN ( value ) || value < 0 ) {
return undefined ;
}
return value ;
}
exports . getInputAsInt = getInputAsInt ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( 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 . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
exports . getInputAsInt = exports . getInputAsArray = exports . isValidEvent = exports . logWarning = exports . getCacheState = exports . setOutputAndState = exports . setCacheHitOutput = exports . setCacheState = exports . isExactKeyMatch = exports . isGhes = void 0 ;
const core = _ _importStar ( _ _webpack _require _ _ ( 470 ) ) ;
const constants _1 = _ _webpack _require _ _ ( 196 ) ;
function isGhes ( ) {
const ghUrl = new URL ( process . env [ "GITHUB_SERVER_URL" ] || "https://github.com" ) ;
return ghUrl . hostname . toUpperCase ( ) !== "GITHUB.COM" ;
}
exports . isGhes = isGhes ;
function isExactKeyMatch ( key , cacheKey ) {
return ! ! ( cacheKey &&
cacheKey . localeCompare ( key , undefined , {
sensitivity : "accent"
} ) === 0 ) ;
}
exports . isExactKeyMatch = isExactKeyMatch ;
function setCacheState ( state ) {
core . saveState ( constants _1 . State . CacheMatchedKey , state ) ;
}
exports . setCacheState = setCacheState ;
function setCacheHitOutput ( isCacheHit ) {
core . setOutput ( constants _1 . Outputs . CacheHit , isCacheHit . toString ( ) ) ;
}
exports . setCacheHitOutput = setCacheHitOutput ;
function setOutputAndState ( key , cacheKey ) {
setCacheHitOutput ( isExactKeyMatch ( key , cacheKey ) ) ;
// Store the matched cache key if it exists
cacheKey && setCacheState ( cacheKey ) ;
}
exports . setOutputAndState = setOutputAndState ;
function getCacheState ( ) {
const cacheKey = core . getState ( constants _1 . State . CacheMatchedKey ) ;
if ( cacheKey ) {
core . debug ( ` Cache state/key: ${ cacheKey } ` ) ;
return cacheKey ;
}
return undefined ;
}
exports . getCacheState = getCacheState ;
function logWarning ( message ) {
const warningPrefix = "[warning]" ;
core . info ( ` ${ warningPrefix } ${ message } ` ) ;
}
exports . logWarning = logWarning ;
// Cache token authorized for all events that are tied to a ref
// See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context
function isValidEvent ( ) {
return constants _1 . RefKey in process . env && Boolean ( process . env [ constants _1 . RefKey ] ) ;
}
exports . isValidEvent = isValidEvent ;
function getInputAsArray ( name , options ) {
return core
. getInput ( name , options )
. split ( "\n" )
. map ( s => s . trim ( ) )
. filter ( x => x !== "" ) ;
}
exports . getInputAsArray = getInputAsArray ;
function getInputAsInt ( name , options ) {
const value = parseInt ( core . getInput ( name , options ) ) ;
if ( isNaN ( value ) || value < 0 ) {
return undefined ;
}
return value ;
}
exports . getInputAsInt = getInputAsInt ;
/***/ } ) ,
@ -47120,90 +47120,94 @@ exports.default = _default;
/***/ ( function ( _ _unusedmodule , exports , _ _webpack _require _ _ ) {
"use strict" ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( 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 . 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 ) {
function fulfilled ( value ) { try { step ( generator . next ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
function rejected ( value ) { try { step ( generator [ "throw" ] ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
function step ( result ) { result . done ? resolve ( result . value ) : adopt ( result . value ) . then ( fulfilled , rejected ) ; }
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
} ) ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const cache = _ _importStar ( _ _webpack _require _ _ ( 692 ) ) ;
const core = _ _importStar ( _ _webpack _require _ _ ( 470 ) ) ;
const constants _1 = _ _webpack _require _ _ ( 196 ) ;
const utils = _ _importStar ( _ _webpack _require _ _ ( 443 ) ) ;
function run ( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
try {
if ( utils . isGhes ( ) ) {
utils . logWarning ( "Cache action is not supported on GHES" ) ;
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 {
yield cache . saveCache ( cachePaths , primaryKey , {
uploadChunkSize : utils . getInputAsInt ( constants _1 . Inputs . UploadChunkSize )
} ) ;
core . info ( ` Cache saved with key: ${ primaryKey } ` ) ;
}
catch ( error ) {
if ( error . name === cache . ValidationError . name ) {
throw error ;
}
else if ( error . name === cache . ReserveCacheError . name ) {
core . info ( error . message ) ;
}
else {
utils . logWarning ( error . message ) ;
}
}
}
catch ( error ) {
utils . logWarning ( error . message ) ;
}
} ) ;
}
run ( ) ;
exports . default = run ;
var _ _createBinding = ( this && this . _ _createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
} ) : ( 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 . 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 ) {
function fulfilled ( value ) { try { step ( generator . next ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
function rejected ( value ) { try { step ( generator [ "throw" ] ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
function step ( result ) { result . done ? resolve ( result . value ) : adopt ( result . value ) . then ( fulfilled , rejected ) ; }
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
} ) ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
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 run ( ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
try {
if ( utils . isGhes ( ) ) {
utils . logWarning ( "Cache action is not supported on GHES" ) ;
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 {
yield cache . saveCache ( cachePaths , primaryKey , {
uploadChunkSize : utils . getInputAsInt ( constants _1 . Inputs . UploadChunkSize )
} ) ;
core . info ( ` Cache saved with key: ${ primaryKey } ` ) ;
}
catch ( error ) {
if ( error . name === cache . ValidationError . name ) {
throw error ;
}
else if ( error . name === cache . ReserveCacheError . name ) {
core . info ( error . message ) ;
}
else {
utils . logWarning ( error . message ) ;
}
}
}
catch ( error ) {
utils . logWarning ( error . message ) ;
}
} ) ;
}
run ( ) ;
exports . default = run ;
/***/ } ) ,