File tree 1 file changed +19
-9
lines changed
1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,14 @@ async function run() {
39
39
} else {
40
40
core . info ( "comment : disabled" ) ;
41
41
}
42
- const pull = await octokit . pulls . get ( {
42
+ const pull = await octokit ? .pulls ? .get ( {
43
43
...context . repo ,
44
44
pull_number : context . payload . pull_request . number
45
- } )
46
- core . info ( pull )
47
- core . info ( `ref : ${ context . payload . pull_request . html_url } ` )
45
+ } ) ;
46
+ if ( pull ) {
47
+ core . debug ( JSON . stringify ( pull ) ) ;
48
+ core . debug ( `ref : ${ context . payload . pull_request . html_url } ` ) ;
49
+ }
48
50
}
49
51
50
52
async function setEnv ( ) {
@@ -80,7 +82,15 @@ async function nowDeploy() {
80
82
if ( workingDirectory ) {
81
83
options . cwd = workingDirectory ;
82
84
}
83
-
85
+ let commitRef = context . ref ;
86
+ if ( context . eventName === "pull_request" ) {
87
+ //commitRef = context.payload.pull_request.number;
88
+ //octokit.
89
+ }
90
+ let commitMessage = commit ;
91
+ if ( context . eventName === "pull_request" ) {
92
+ //commitMessage =
93
+ }
84
94
await exec . exec (
85
95
"npx" ,
86
96
[
@@ -107,10 +117,10 @@ async function nowDeploy() {
107
117
"-m" ,
108
118
`githubCommitMessage=${ commit } ` ,
109
119
"-m" ,
110
- `githubCommitRef=${ context . ref } `
111
- ] ,
112
- options
113
- ) ;
120
+ `githubCommitRef=${ commitRef } `
121
+ ] ,
122
+ options
123
+ ) ;
114
124
115
125
return myOutput ;
116
126
}
You can’t perform that action at this time.
0 commit comments