File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,11 +41,14 @@ async function run() {
4141 core . info ( `event name: ${ eventName } ` ) ;
4242 core . info ( `sha: ${ sha } ` ) ;
4343 if ( sha ) {
44- const q = encodeURIComponent ( `hash:${ sha } ` ) ;
45- core . info ( `q: ${ q } ` ) ;
46- const commit = await octokit . rest . search . commits ( { q } ) ;
47- core . info ( `count of commits ${ commit . data . total_count } ` ) ;
48- core . info ( `message: ${ commit . data . items [ 0 ] . commit . message } ` ) ;
44+ const q = `hash:${ sha } ` ;
45+ console . info ( `q: ${ q } ` ) ;
46+ const response = await octokit . rest . search . commits ( { q } ) ;
47+ core . info ( `count of commits ${ response . data . total_count } ` ) ;
48+ for ( const { commit } of response . data . items ) {
49+ core . info ( `message: ${ commit . url } ` ) ;
50+ core . info ( `message: ${ commit . message } ` ) ;
51+ }
4952 if ( true ) {
5053 core . setOutput ( OUTPUT_PARAMS . SHOULD_EXECUTE , true ) ;
5154 return ;
Original file line number Diff line number Diff line change @@ -24,11 +24,15 @@ async function run() {
2424 core . info ( `event name: ${ eventName } ` )
2525 core . info ( `sha: ${ sha } ` )
2626 if ( sha ) {
27- const q = encodeURIComponent ( `hash:${ sha } ` )
28- core . info ( `q: ${ q } ` , )
29- const commit = await octokit . rest . search . commits ( { q} )
30- core . info ( `count of commits ${ commit . data . total_count } ` )
31- core . info ( `message: ${ commit . data . items [ 0 ] . commit . message } ` )
27+ const q = `hash:${ sha } `
28+ console . info ( `q: ${ q } ` , )
29+ const response = await octokit . rest . search . commits ( { q} )
30+ core . info ( `count of commits ${ response . data . total_count } ` )
31+ for ( const { commit} of response . data . items ) {
32+ core . info ( `message: ${ commit . url } ` )
33+ core . info ( `message: ${ commit . message } ` )
34+ }
35+
3236 if ( true ) {
3337 core . setOutput ( OUTPUT_PARAMS . SHOULD_EXECUTE , true )
3438 return
You can’t perform that action at this time.
0 commit comments