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 ( ) ;
/******/ } )
/************************************************************************/
/******/ ( {
/***/ 87 :
/***/ ( function ( module ) {
module . exports = require ( "os" ) ;
/***/ } ) ,
/***/ 104 :
/***/ ( function ( _ _unusedmodule , _ _unusedexports , _ _webpack _require _ _ ) {
const core = _ _webpack _require _ _ ( 470 ) ;
const child _process = _ _webpack _require _ _ ( 129 ) ;
const fs = _ _webpack _require _ _ ( 747 ) ;
try {
2020-01-14 09:29:16 +00:00
2019-09-15 07:32:43 +00:00
const home = process . env [ 'HOME' ] ;
const homeSsh = home + '/.ssh' ;
2020-01-14 09:29:16 +00:00
const privateKey = core . getInput ( 'ssh-private-key' ) . trim ( ) ;
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 ;
}
2019-09-15 07:32:43 +00:00
console . log ( ` Adding GitHub.com keys to ${ homeSsh } /known_hosts ` ) ;
fs . mkdirSync ( homeSsh , { recursive : true } ) ;
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" ) ;
const authSock = core . getInput ( 'ssh-auth-sock' ) ;
child _process . execFileSync ( 'ssh-agent' , [ '-a' , authSock ] ) ;
core . exportVariable ( 'SSH_AUTH_SOCK' , authSock ) ;
console . log ( "Adding private key to agent" ) ;
2020-01-14 09:29:16 +00:00
privateKey . split ( /(?=-----BEGIN)/ ) . forEach ( function ( key ) {
2020-01-14 09:21:11 +00:00
child _process . execSync ( 'ssh-add -' , { input : key . trim ( ) + "\n" } ) ;
} ) ;
2020-01-14 09:29:16 +00:00
2020-01-14 09:21:11 +00:00
console . log ( "Keys added:" ) ;
child _process . execSync ( 'ssh-add -l' , { stdio : 'inherit' } ) ;
2020-01-14 09:29:16 +00:00
2019-09-14 22:28:16 +00:00
} catch ( error ) {
core . setFailed ( error . message ) ;
}
/***/ } ) ,
/***/ 129 :
/***/ ( function ( module ) {
module . exports = require ( "child_process" ) ;
/***/ } ) ,
/***/ 431 :
/***/ ( function ( _ _unusedmodule , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const os = _ _webpack _require _ _ ( 87 ) ;
/ * *
* Commands
*
* Command Format :
* # # [ name key = value ; key = value ] message
*
* Examples :
* # # [ warning ] This is the user warning message
* # # [ set - secret name = mypassword ] definitelyNotAPassword !
* /
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 ;
const CMD _PREFIX = '##[' ;
class Command {
constructor ( command , properties , message ) {
if ( ! command ) {
command = 'missing.command' ;
}
this . command = command ;
this . properties = properties ;
this . message = message ;
}
toString ( ) {
let cmdStr = CMD _PREFIX + this . command ;
if ( this . properties && Object . keys ( this . properties ) . length > 0 ) {
cmdStr += ' ' ;
for ( const key in this . properties ) {
if ( this . properties . hasOwnProperty ( key ) ) {
const val = this . properties [ key ] ;
if ( val ) {
// safely append the val - avoid blowing up when attempting to
// call .replace() if message is not a string for some reason
cmdStr += ` ${ key } = ${ escape ( ` ${ val || '' } ` ) } ; ` ;
}
}
}
}
cmdStr += ']' ;
// safely append the message - avoid blowing up when attempting to
// call .replace() if message is not a string for some reason
const message = ` ${ this . message || '' } ` ;
cmdStr += escapeData ( message ) ;
return cmdStr ;
}
}
function escapeData ( s ) {
return s . replace ( /\r/g , '%0D' ) . replace ( /\n/g , '%0A' ) ;
}
function escape ( s ) {
return s
. replace ( /\r/g , '%0D' )
. replace ( /\n/g , '%0A' )
. replace ( /]/g , '%5D' )
. replace ( /;/g , '%3B' ) ;
}
//# 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 ( ) ) ;
} ) ;
} ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
const command _1 = _ _webpack _require _ _ ( 431 ) ;
const path = _ _webpack _require _ _ ( 622 ) ;
/ * *
* 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
//-----------------------------------------------------------------------
/ * *
* sets env variable for this action and future actions in the job
* @ param name the name of the variable to set
* @ param val the value of the variable
* /
function exportVariable ( name , val ) {
process . env [ name ] = val ;
command _1 . issueCommand ( 'set-env' , { name } , val ) ;
}
exports . exportVariable = exportVariable ;
/ * *
* exports the variable and registers a secret which will get masked from logs
* @ param name the name of the variable to set
* @ param val value of the secret
* /
function exportSecret ( name , val ) {
exportVariable ( name , val ) ;
// the runner will error with not implemented
// leaving the function but raising the error earlier
command _1 . issueCommand ( 'set-secret' , { } , val ) ;
throw new Error ( 'Not implemented.' ) ;
}
exports . exportSecret = exportSecret ;
/ * *
* Prepends inputPath to the PATH ( for this action and future actions )
* @ param inputPath
* /
function addPath ( inputPath ) {
command _1 . issueCommand ( 'add-path' , { } , inputPath ) ;
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 ) {
const val = process . env [ ` INPUT_ ${ name . replace ( ' ' , '_' ) . toUpperCase ( ) } ` ] || '' ;
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
* @ param value value to store
* /
function setOutput ( name , value ) {
command _1 . issueCommand ( 'set-output' , { name } , value ) ;
}
exports . setOutput = setOutput ;
//-----------------------------------------------------------------------
// 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
//-----------------------------------------------------------------------
/ * *
* 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
* @ param message error issue message
* /
function error ( message ) {
command _1 . issue ( 'error' , message ) ;
}
exports . error = error ;
/ * *
* Adds an warning issue
* @ param message warning issue message
* /
function warning ( message ) {
command _1 . issue ( 'warning' , message ) ;
}
exports . warning = warning ;
/ * *
* 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 ;
//# sourceMappingURL=core.js.map
/***/ } ) ,
/***/ 622 :
/***/ ( function ( module ) {
module . exports = require ( "path" ) ;
/***/ } ) ,
/***/ 747 :
/***/ ( function ( module ) {
module . exports = require ( "fs" ) ;
/***/ } )
/******/ } ) ;