File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -118,12 +118,12 @@ exports.issueCommand = issueCommand;
118
118
const core = __webpack_require__ ( 470 ) ;
119
119
const child_process = __webpack_require__ ( 129 ) ;
120
120
const fs = __webpack_require__ ( 747 ) ;
121
+ const os = __webpack_require__ ( 87 ) ;
121
122
122
123
try {
123
124
124
- const home = process . env [ 'HOME' ] ;
125
+ const home = os . homedir ( ) ;
125
126
const homeSsh = home + '/.ssh' ;
126
-
127
127
const privateKey = core . getInput ( 'ssh-private-key' ) ;
128
128
129
129
if ( ! privateKey ) {
@@ -132,6 +132,11 @@ try {
132
132
return ;
133
133
}
134
134
135
+ if ( process . env [ 'OS' ] == 'Windows_NT' ) {
136
+ console . log ( 'Preparing ssh-agent service on Windows' ) ;
137
+ child_process . execSync ( 'sc config ssh-agent start=demand' , { stdio : 'inherit' } ) ;
138
+ }
139
+
135
140
console . log ( `Adding GitHub.com keys to ${ homeSsh } /known_hosts` ) ;
136
141
fs . mkdirSync ( homeSsh , { recursive : true } ) ;
137
142
fs . appendFileSync ( `${ homeSsh } /known_hosts` , '\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n' ) ;
Original file line number Diff line number Diff line change 1
1
const core = require ( '@actions/core' ) ;
2
2
const child_process = require ( 'child_process' ) ;
3
3
const fs = require ( 'fs' ) ;
4
+ const os = require ( 'os' ) ;
4
5
5
6
try {
6
7
7
- const home = process . env [ 'HOME' ] ;
8
+ const home = os . homedir ( ) ;
8
9
const homeSsh = home + '/.ssh' ;
9
-
10
10
const privateKey = core . getInput ( 'ssh-private-key' ) ;
11
11
12
12
if ( ! privateKey ) {
15
15
return ;
16
16
}
17
17
18
+ if ( process . env [ 'OS' ] == 'Windows_NT' ) {
19
+ console . log ( 'Preparing ssh-agent service on Windows' ) ;
20
+ child_process . execSync ( 'sc config ssh-agent start=demand' , { stdio : 'inherit' } ) ;
21
+ }
22
+
18
23
console . log ( `Adding GitHub.com keys to ${ homeSsh } /known_hosts` ) ;
19
24
fs . mkdirSync ( homeSsh , { recursive : true } ) ;
20
25
fs . appendFileSync ( `${ homeSsh } /known_hosts` , '\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n' ) ;
You can’t perform that action at this time.
0 commit comments