2019-09-14 22:28:16 +00:00
module . exports =
/******/ ( function ( modules , runtime ) { // webpackBootstrap
/******/ "use strict" ;
/******/ // The module cache
/******/ var installedModules = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/
/******/ // Check if module is in cache
/******/ if ( installedModules [ moduleId ] ) {
/******/ return installedModules [ moduleId ] . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules [ moduleId ] = {
/******/ i : moduleId ,
/******/ l : false ,
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Flag the module as loaded
/******/ module . l = true ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/******/
/******/ _ _webpack _require _ _ . ab = _ _dirname + "/" ;
/******/
/******/ // the startup function
/******/ function startup ( ) {
/******/ // Load entry module and return exports
/******/ return _ _webpack _require _ _ ( 104 ) ;
/******/ } ;
/******/
/******/ // run startup
/******/ return startup ( ) ;
/******/ } )
/************************************************************************/
/******/ ( {
2020-10-07 21:06:49 +00:00
/***/ 82 :
/***/ ( function ( _ _unusedmodule , exports ) {
"use strict" ;
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
/ * *
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @ param input input to sanitize into a string
* /
function toCommandValue ( input ) {
if ( input === null || input === undefined ) {
return '' ;
}
else if ( typeof input === 'string' || input instanceof String ) {
return input ;
}
return JSON . stringify ( input ) ;
}
exports . toCommandValue = toCommandValue ;
//# sourceMappingURL=utils.js.map
/***/ } ) ,
2019-09-14 22:28:16 +00:00
/***/ 87 :
/***/ ( function ( module ) {
module . exports = require ( "os" ) ;
/***/ } ) ,
2020-10-07 21:06:49 +00:00
/***/ 102 :
/***/ ( function ( _ _unusedmodule , exports , _ _webpack _require _ _ ) {
"use strict" ;
// For internal use, subject to change.
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
result [ "default" ] = mod ;
return result ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = _ _importStar ( _ _webpack _require _ _ ( 747 ) ) ;
const os = _ _importStar ( _ _webpack _require _ _ ( 87 ) ) ;
const utils _1 = _ _webpack _require _ _ ( 82 ) ;
function issueCommand ( command , message ) {
const filePath = process . env [ ` GITHUB_ ${ command } ` ] ;
if ( ! filePath ) {
throw new Error ( ` Unable to find environment variable for file command ${ command } ` ) ;
}
if ( ! fs . existsSync ( filePath ) ) {
throw new Error ( ` Missing file at path: ${ filePath } ` ) ;
}
fs . appendFileSync ( filePath , ` ${ utils _1 . toCommandValue ( message ) } ${ os . EOL } ` , {
encoding : 'utf8'
} ) ;
}
exports . issueCommand = issueCommand ;
//# sourceMappingURL=file-command.js.map
/***/ } ) ,
2019-09-14 22:28:16 +00:00
/***/ 104 :
/***/ ( function ( _ _unusedmodule , _ _unusedexports , _ _webpack _require _ _ ) {
const core = _ _webpack _require _ _ ( 470 ) ;
const child _process = _ _webpack _require _ _ ( 129 ) ;
const fs = _ _webpack _require _ _ ( 747 ) ;
2021-02-19 13:37:34 +00:00
const crypto = _ _webpack _require _ _ ( 417 ) ;
2021-03-10 07:19:17 +00:00
const { home , sshAgent , sshAdd } = _ _webpack _require _ _ ( 972 ) ;
2019-09-14 22:28:16 +00:00
try {
2020-05-18 07:08:29 +00:00
const privateKey = core . getInput ( 'ssh-private-key' ) ;
2020-01-14 09:29:16 +00:00
if ( ! privateKey ) {
core . setFailed ( "The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file." ) ;
return ;
}
2021-02-13 20:02:34 +00:00
const homeSsh = home + '/.ssh' ;
2019-09-15 07:32:43 +00:00
console . log ( ` Adding GitHub.com keys to ${ homeSsh } /known_hosts ` ) ;
2021-03-10 07:19:17 +00:00
2020-05-18 07:08:29 +00:00
fs . mkdirSync ( homeSsh , { recursive : true } ) ;
2019-09-15 07:32:43 +00:00
fs . appendFileSync ( ` ${ homeSsh } /known_hosts ` , '\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n' ) ;
fs . appendFileSync ( ` ${ homeSsh } /known_hosts ` , '\ngithub.com ssh-dss AAAAB3NzaC1kc3MAAACBANGFW2P9xlGU3zWrymJgI/lKo//ZW2WfVtmbsUZJ5uyKArtlQOT2+WRhcg4979aFxgKdcsqAYW3/LS1T2km3jYW/vr4Uzn+dXWODVk5VlUiZ1HFOHf6s6ITcZvjvdbp6ZbpM+DuJT7Bw+h5Fx8Qt8I16oCZYmAPJRtu46o9C2zk1AAAAFQC4gdFGcSbp5Gr0Wd5Ay/jtcldMewAAAIATTgn4sY4Nem/FQE+XJlyUQptPWMem5fwOcWtSXiTKaaN0lkk2p2snz+EJvAGXGq9dTSWHyLJSM2W6ZdQDqWJ1k+cL8CARAqL+UMwF84CR0m3hj+wtVGD/J4G5kW2DBAf4/bqzP4469lT+dF2FRQ2L9JKXrCWcnhMtJUvua8dvnwAAAIB6C4nQfAA7x8oLta6tT+oCk2WQcydNsyugE8vLrHlogoWEicla6cWPk7oXSspbzUcfkjN3Qa6e74PhRkc7JdSdAlFzU3m7LMkXo1MHgkqNX8glxWNVqBSc0YRdbFdTkL0C6gtpklilhvuHQCdbgB3LBAikcRkDp+FCVkUgPC/7Rw==\n' ) ;
2019-09-14 22:28:16 +00:00
console . log ( "Starting ssh-agent" ) ;
2021-03-10 07:19:17 +00:00
2019-09-14 22:28:16 +00:00
const authSock = core . getInput ( 'ssh-auth-sock' ) ;
2021-03-10 07:19:17 +00:00
const sshAgentArgs = ( authSock && authSock . length > 0 ) ? [ '-a' , authSock ] : [ ] ;
2020-05-18 07:08:29 +00:00
// Extract auth socket path and agent pid and set them as job variables
2021-03-10 07:19:17 +00:00
child _process . execFileSync ( sshAgent , sshAgentArgs ) . toString ( ) . split ( "\n" ) . forEach ( function ( line ) {
const matches = /^(SSH_AUTH_SOCK|SSH_AGENT_PID)=(.*); export \1/ . exec ( line ) ;
2020-05-18 07:08:29 +00:00
if ( matches && matches . length > 0 ) {
2021-03-10 07:19:17 +00:00
// This will also set process.env accordingly, so changes take effect for this script
2020-05-18 07:08:29 +00:00
core . exportVariable ( matches [ 1 ] , matches [ 2 ] )
2021-03-10 07:19:17 +00:00
console . log ( ` ${ matches [ 1 ] } = ${ matches [ 2 ] } ` ) ;
2020-05-18 07:08:29 +00:00
}
2021-03-10 07:19:17 +00:00
} ) ;
console . log ( "Adding private key(s) to agent" ) ;
2019-09-14 22:28:16 +00:00
2020-01-14 09:29:16 +00:00
privateKey . split ( /(?=-----BEGIN)/ ) . forEach ( function ( key ) {
2021-03-10 07:19:17 +00:00
child _process . execFileSync ( sshAdd , [ '-' ] , { input : key . trim ( ) + "\n" } ) ;
2020-01-14 09:21:11 +00:00
} ) ;
2020-01-14 09:29:16 +00:00
2021-03-10 07:19:17 +00:00
console . log ( "Key(s) added:" ) ;
child _process . execFileSync ( sshAdd , [ '-l' ] , { stdio : 'inherit' } ) ;
console . log ( 'Configuring deployment key(s)' ) ;
2020-01-14 09:29:16 +00:00
2021-03-10 07:19:17 +00:00
child _process . execFileSync ( sshAdd , [ '-L' ] ) . toString ( ) . split ( /\r?\n/ ) . forEach ( function ( key ) {
2021-03-17 18:27:52 +00:00
const parts = key . match ( /\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i ) ;
2021-02-19 13:37:34 +00:00
2021-03-10 07:19:17 +00:00
if ( ! parts ) {
2021-03-17 18:50:49 +00:00
console . log ( ` Comment for key ' ${ key } ' does not match GitHub URL pattern. Not treating it as a GitHub deploy key. ` ) ;
2021-02-19 13:37:34 +00:00
return ;
}
2021-03-10 07:19:17 +00:00
const sha256 = crypto . createHash ( 'sha256' ) . update ( key ) . digest ( 'hex' ) ;
const ownerAndRepo = parts [ 1 ] . replace ( /\.git$/ , '' ) ;
2021-02-19 13:37:34 +00:00
2021-03-10 07:19:17 +00:00
fs . writeFileSync ( ` ${ homeSsh } /key- ${ sha256 } ` , key + "\n" , { mode : '600' } ) ;
2021-02-19 13:37:34 +00:00
2021-03-10 07:19:17 +00:00
child _process . execSync ( ` git config --global --replace-all url."git@key- ${ sha256 } .github.com: ${ ownerAndRepo } ".insteadOf "https://github.com/ ${ ownerAndRepo } " ` ) ;
child _process . execSync ( ` git config --global --add url."git@key- ${ sha256 } .github.com: ${ ownerAndRepo } ".insteadOf "git@github.com: ${ ownerAndRepo } " ` ) ;
child _process . execSync ( ` git config --global --add url."git@key- ${ sha256 } .github.com: ${ ownerAndRepo } ".insteadOf "ssh://git@github.com/ ${ ownerAndRepo } " ` ) ;
2021-02-19 13:37:34 +00:00
2021-03-10 07:19:17 +00:00
const sshConfig = ` \n Host key- ${ sha256 } .github.com \n `
2021-02-19 13:37:34 +00:00
+ ` HostName github.com \n `
2021-03-10 07:19:17 +00:00
+ ` IdentityFile ${ homeSsh } /key- ${ sha256 } \n `
2021-02-19 13:37:34 +00:00
+ ` IdentitiesOnly yes \n ` ;
fs . appendFileSync ( ` ${ homeSsh } /config ` , sshConfig ) ;
2021-03-10 07:19:17 +00:00
console . log ( ` Added deploy-key mapping: Use identity ' ${ homeSsh } /key- ${ sha256 } ' for GitHub repository ${ ownerAndRepo } ` ) ;
2021-02-19 13:37:34 +00:00
} ) ;
2019-09-14 22:28:16 +00:00
} catch ( error ) {
2021-03-05 20:17:14 +00:00
if ( error . code == 'ENOENT' ) {
console . log ( ` The ' ${ error . path } ' executable could not be found. Please make sure it is on your PATH and/or the necessary packages are installed. ` ) ;
console . log ( ` PATH is set to: ${ process . env . PATH } ` ) ;
}
2019-09-14 22:28:16 +00:00
core . setFailed ( error . message ) ;
}
/***/ } ) ,
/***/ 129 :
/***/ ( function ( module ) {
module . exports = require ( "child_process" ) ;
/***/ } ) ,
2021-02-19 13:37:34 +00:00
/***/ 417 :
/***/ ( function ( module ) {
module . exports = require ( "crypto" ) ;
/***/ } ) ,
2019-09-14 22:28:16 +00:00
/***/ 431 :
/***/ ( function ( _ _unusedmodule , exports , _ _webpack _require _ _ ) {
"use strict" ;
2020-06-24 06:31:28 +00:00
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
result [ "default" ] = mod ;
return result ;
} ;
2019-09-14 22:28:16 +00:00
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
2020-06-24 06:31:28 +00:00
const os = _ _importStar ( _ _webpack _require _ _ ( 87 ) ) ;
2020-10-07 21:06:49 +00:00
const utils _1 = _ _webpack _require _ _ ( 82 ) ;
2019-09-14 22:28:16 +00:00
/ * *
* Commands
*
* Command Format :
2020-06-24 06:31:28 +00:00
* : : name key = value , key = value : : message
2019-09-14 22:28:16 +00:00
*
* Examples :
2020-06-24 06:31:28 +00:00
* : : warning : : This is the message
* : : set - env name = MY _VAR : : some value
2019-09-14 22:28:16 +00:00
* /
function issueCommand ( command , properties , message ) {
const cmd = new Command ( command , properties , message ) ;
process . stdout . write ( cmd . toString ( ) + os . EOL ) ;
}
exports . issueCommand = issueCommand ;
function issue ( name , message = '' ) {
issueCommand ( name , { } , message ) ;
}
exports . issue = issue ;
2020-06-24 06:31:28 +00:00
const CMD _STRING = '::' ;
2019-09-14 22:28:16 +00:00
class Command {
constructor ( command , properties , message ) {
if ( ! command ) {
command = 'missing.command' ;
}
this . command = command ;
this . properties = properties ;
this . message = message ;
}
toString ( ) {
2020-06-24 06:31:28 +00:00
let cmdStr = CMD _STRING + this . command ;
2019-09-14 22:28:16 +00:00
if ( this . properties && Object . keys ( this . properties ) . length > 0 ) {
cmdStr += ' ' ;
2020-06-24 06:31:28 +00:00
let first = true ;
2019-09-14 22:28:16 +00:00
for ( const key in this . properties ) {
if ( this . properties . hasOwnProperty ( key ) ) {
const val = this . properties [ key ] ;
if ( val ) {
2020-06-24 06:31:28 +00:00
if ( first ) {
first = false ;
}
else {
cmdStr += ',' ;
}
cmdStr += ` ${ key } = ${ escapeProperty ( val ) } ` ;
2019-09-14 22:28:16 +00:00
}
}
}
}
2020-06-24 06:31:28 +00:00
cmdStr += ` ${ CMD _STRING } ${ escapeData ( this . message ) } ` ;
2019-09-14 22:28:16 +00:00
return cmdStr ;
}
}
function escapeData ( s ) {
2020-10-07 21:06:49 +00:00
return utils _1 . toCommandValue ( s )
2020-06-24 06:31:28 +00:00
. replace ( /%/g , '%25' )
. replace ( /\r/g , '%0D' )
. replace ( /\n/g , '%0A' ) ;
2019-09-14 22:28:16 +00:00
}
2020-06-24 06:31:28 +00:00
function escapeProperty ( s ) {
2020-10-07 21:06:49 +00:00
return utils _1 . toCommandValue ( s )
2020-06-24 06:31:28 +00:00
. replace ( /%/g , '%25' )
2019-09-14 22:28:16 +00:00
. replace ( /\r/g , '%0D' )
. replace ( /\n/g , '%0A' )
2020-06-24 06:31:28 +00:00
. replace ( /:/g , '%3A' )
. replace ( /,/g , '%2C' ) ;
2019-09-14 22:28:16 +00:00
}
//# sourceMappingURL=command.js.map
/***/ } ) ,
/***/ 470 :
/***/ ( function ( _ _unusedmodule , exports , _ _webpack _require _ _ ) {
"use strict" ;
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 ( ) ) ;
} ) ;
} ;
2020-06-24 06:31:28 +00:00
var _ _importStar = ( this && this . _ _importStar ) || function ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
result [ "default" ] = mod ;
return result ;
} ;
2019-09-14 22:28:16 +00:00
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const command _1 = _ _webpack _require _ _ ( 431 ) ;
2020-10-07 21:06:49 +00:00
const file _command _1 = _ _webpack _require _ _ ( 102 ) ;
const utils _1 = _ _webpack _require _ _ ( 82 ) ;
2020-06-24 06:31:28 +00:00
const os = _ _importStar ( _ _webpack _require _ _ ( 87 ) ) ;
const path = _ _importStar ( _ _webpack _require _ _ ( 622 ) ) ;
2019-09-14 22:28:16 +00:00
/ * *
* The code to exit an action
* /
var ExitCode ;
( function ( ExitCode ) {
/ * *
* A code indicating that the action was successful
* /
ExitCode [ ExitCode [ "Success" ] = 0 ] = "Success" ;
/ * *
* A code indicating that the action was a failure
* /
ExitCode [ ExitCode [ "Failure" ] = 1 ] = "Failure" ;
} ) ( ExitCode = exports . ExitCode || ( exports . ExitCode = { } ) ) ;
//-----------------------------------------------------------------------
// Variables
//-----------------------------------------------------------------------
/ * *
2020-06-24 06:31:28 +00:00
* Sets env variable for this action and future actions in the job
2019-09-14 22:28:16 +00:00
* @ param name the name of the variable to set
2020-06-24 06:31:28 +00:00
* @ param val the value of the variable . Non - string values will be converted to a string via JSON . stringify
2019-09-14 22:28:16 +00:00
* /
2020-06-24 06:31:28 +00:00
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2019-09-14 22:28:16 +00:00
function exportVariable ( name , val ) {
2020-10-07 21:06:49 +00:00
const convertedVal = utils _1 . toCommandValue ( val ) ;
2020-06-24 06:31:28 +00:00
process . env [ name ] = convertedVal ;
2020-10-07 21:06:49 +00:00
const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
if ( filePath ) {
const delimiter = '_GitHubActionsFileCommandDelimeter_' ;
const commandValue = ` ${ name } << ${ delimiter } ${ os . EOL } ${ convertedVal } ${ os . EOL } ${ delimiter } ` ;
file _command _1 . issueCommand ( 'ENV' , commandValue ) ;
}
else {
command _1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
}
2019-09-14 22:28:16 +00:00
}
exports . exportVariable = exportVariable ;
/ * *
2020-06-24 06:31:28 +00:00
* Registers a secret which will get masked from logs
* @ param secret value of the secret
2019-09-14 22:28:16 +00:00
* /
2020-06-24 06:31:28 +00:00
function setSecret ( secret ) {
command _1 . issueCommand ( 'add-mask' , { } , secret ) ;
2019-09-14 22:28:16 +00:00
}
2020-06-24 06:31:28 +00:00
exports . setSecret = setSecret ;
2019-09-14 22:28:16 +00:00
/ * *
* Prepends inputPath to the PATH ( for this action and future actions )
* @ param inputPath
* /
function addPath ( inputPath ) {
2020-10-07 21:06:49 +00:00
const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
if ( filePath ) {
file _command _1 . issueCommand ( 'PATH' , inputPath ) ;
}
else {
command _1 . issueCommand ( 'add-path' , { } , inputPath ) ;
}
2019-09-14 22:28:16 +00:00
process . env [ 'PATH' ] = ` ${ inputPath } ${ path . delimiter } ${ process . env [ 'PATH' ] } ` ;
}
exports . addPath = addPath ;
/ * *
* Gets the value of an input . The value is also trimmed .
*
* @ param name name of the input to get
* @ param options optional . See InputOptions .
* @ returns string
* /
function getInput ( name , options ) {
2020-06-24 06:31:28 +00:00
const val = process . env [ ` INPUT_ ${ name . replace ( / /g , '_' ) . toUpperCase ( ) } ` ] || '' ;
2019-09-14 22:28:16 +00:00
if ( options && options . required && ! val ) {
throw new Error ( ` Input required and not supplied: ${ name } ` ) ;
}
return val . trim ( ) ;
}
exports . getInput = getInput ;
/ * *
* Sets the value of an output .
*
* @ param name name of the output to set
2020-06-24 06:31:28 +00:00
* @ param value value to store . Non - string values will be converted to a string via JSON . stringify
2019-09-14 22:28:16 +00:00
* /
2020-06-24 06:31:28 +00:00
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2019-09-14 22:28:16 +00:00
function setOutput ( name , value ) {
command _1 . issueCommand ( 'set-output' , { name } , value ) ;
}
exports . setOutput = setOutput ;
2020-06-24 06:31:28 +00:00
/ * *
* Enables or disables the echoing of commands into stdout for the rest of the step .
* Echoing is disabled by default if ACTIONS _STEP _DEBUG is not set .
*
* /
function setCommandEcho ( enabled ) {
command _1 . issue ( 'echo' , enabled ? 'on' : 'off' ) ;
}
exports . setCommandEcho = setCommandEcho ;
2019-09-14 22:28:16 +00:00
//-----------------------------------------------------------------------
// Results
//-----------------------------------------------------------------------
/ * *
* Sets the action status to failed .
* When the action exits it will be with an exit code of 1
* @ param message add error issue message
* /
function setFailed ( message ) {
process . exitCode = ExitCode . Failure ;
error ( message ) ;
}
exports . setFailed = setFailed ;
//-----------------------------------------------------------------------
// Logging Commands
//-----------------------------------------------------------------------
2020-06-24 06:31:28 +00:00
/ * *
* Gets whether Actions Step Debug is on or not
* /
function isDebug ( ) {
return process . env [ 'RUNNER_DEBUG' ] === '1' ;
}
exports . isDebug = isDebug ;
2019-09-14 22:28:16 +00:00
/ * *
* Writes debug message to user log
* @ param message debug message
* /
function debug ( message ) {
command _1 . issueCommand ( 'debug' , { } , message ) ;
}
exports . debug = debug ;
/ * *
* Adds an error issue
2020-06-24 06:31:28 +00:00
* @ param message error issue message . Errors will be converted to string via toString ( )
2019-09-14 22:28:16 +00:00
* /
function error ( message ) {
2020-06-24 06:31:28 +00:00
command _1 . issue ( 'error' , message instanceof Error ? message . toString ( ) : message ) ;
2019-09-14 22:28:16 +00:00
}
exports . error = error ;
/ * *
* Adds an warning issue
2020-06-24 06:31:28 +00:00
* @ param message warning issue message . Errors will be converted to string via toString ( )
2019-09-14 22:28:16 +00:00
* /
function warning ( message ) {
2020-06-24 06:31:28 +00:00
command _1 . issue ( 'warning' , message instanceof Error ? message . toString ( ) : message ) ;
2019-09-14 22:28:16 +00:00
}
exports . warning = warning ;
2020-06-24 06:31:28 +00:00
/ * *
* Writes info to log with console . log .
* @ param message info message
* /
function info ( message ) {
process . stdout . write ( message + os . EOL ) ;
}
exports . info = info ;
2019-09-14 22:28:16 +00:00
/ * *
* Begin an output group .
*
* Output until the next ` groupEnd ` will be foldable in this group
*
* @ param name The name of the output group
* /
function startGroup ( name ) {
command _1 . issue ( 'group' , name ) ;
}
exports . startGroup = startGroup ;
/ * *
* End an output group .
* /
function endGroup ( ) {
command _1 . issue ( 'endgroup' ) ;
}
exports . endGroup = endGroup ;
/ * *
* Wrap an asynchronous function call in a group .
*
* Returns the same type as the function itself .
*
* @ param name The name of the group
* @ param fn The function to wrap in the group
* /
function group ( name , fn ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
startGroup ( name ) ;
let result ;
try {
result = yield fn ( ) ;
}
finally {
endGroup ( ) ;
}
return result ;
} ) ;
}
exports . group = group ;
2020-06-24 06:31:28 +00:00
//-----------------------------------------------------------------------
// Wrapper action state
//-----------------------------------------------------------------------
/ * *
* Saves state for current action , the state can only be retrieved by this action ' s post job execution .
*
* @ param name name of the state to store
* @ param value value to store . Non - string values will be converted to a string via JSON . stringify
* /
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function saveState ( name , value ) {
command _1 . issueCommand ( 'save-state' , { name } , value ) ;
}
exports . saveState = saveState ;
/ * *
* Gets the value of an state set by this action ' s main execution .
*
* @ param name name of the state to get
* @ returns string
* /
function getState ( name ) {
return process . env [ ` STATE_ ${ name } ` ] || '' ;
}
exports . getState = getState ;
2019-09-14 22:28:16 +00:00
//# sourceMappingURL=core.js.map
/***/ } ) ,
/***/ 622 :
/***/ ( function ( module ) {
module . exports = require ( "path" ) ;
/***/ } ) ,
/***/ 747 :
/***/ ( function ( module ) {
module . exports = require ( "fs" ) ;
2021-03-10 07:19:17 +00:00
/***/ } ) ,
/***/ 972 :
/***/ ( function ( module , _ _unusedexports , _ _webpack _require _ _ ) {
const os = _ _webpack _require _ _ ( 87 ) ;
module . exports = ( process . env [ 'OS' ] != 'Windows_NT' ) ? {
// Use getent() system call, since this is what ssh does; makes a difference in Docker-based
// Action runs, where $HOME is different from the pwent
home : os . userInfo ( ) . homedir ,
sshAgent : 'ssh-agent' ,
sshAdd : 'ssh-add'
} : {
home : os . homedir ( ) ,
sshAgent : 'c://progra~1//git//usr//bin//ssh-agent.exe' ,
sshAdd : 'c://progra~1//git//usr//bin//ssh-add.exe'
} ;
2019-09-14 22:28:16 +00:00
/***/ } )
/******/ } ) ;