File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -6,22 +6,29 @@ async function findShaForPlan(): Promise<string> {
66 const github = await GitHub . getGitHub ( )
77
88 if ( context . eventName !== 'push' ) {
9+ console . log (
10+ `This is not a push event ("${ context . eventName } "); returning "${ context . sha } "`
11+ )
912 return context . sha
1013 }
1114
15+ const q = `repo:${ context . repo . owner } /${ context . repo . repo } ${ context . sha } type:pr is:merged`
16+ console . log ( `Running advanced query: ${ q } ` )
1217 const pulls = await github . client . paginate (
1318 github . client . search . issuesAndPullRequests ,
1419 {
15- q : `repository: ${ context . repo . owner } / ${ context . repo . repo } ${ context . sha } type:pr is:merged` ,
20+ q,
1621 advanced_search : 'true'
1722 }
1823 )
1924
2025 if ( pulls . length === 0 ) {
26+ console . log ( 'Got 0 pull request, returning empty string' )
2127 return ''
2228 }
2329
2430 const pull = pulls [ 0 ]
31+ console . log ( `Processing pull request number ${ pull . number } ` )
2532 const commits = await github . client . paginate (
2633 github . client . pulls . listCommits ,
2734 {
@@ -31,9 +38,12 @@ async function findShaForPlan(): Promise<string> {
3138 )
3239
3340 if ( commits . length === 0 ) {
41+ console . log ( 'Found 0 commits, returning empty string' )
3442 return ''
3543 }
3644
45+ const commit = commits [ commits . length - 1 ]
46+ console . log ( `Returning commit ${ commit . sha } ` )
3747 return commits [ commits . length - 1 ] . sha
3848}
3949
You can’t perform that action at this time.
0 commit comments