File tree Expand file tree Collapse file tree 3 files changed +309
-93
lines changed Expand file tree Collapse file tree 3 files changed +309
-93
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,22 @@ const getCommitDepth = () => {
22
22
return Number . isNaN ( commitDepth ) ? null : Math . max ( commitDepth , 0 )
23
23
}
24
24
25
- const getPushEventCommits = ( ) => {
26
- const mappedCommits = eventContext . payload . commits . map ( ( commit ) => ( {
27
- message : commit . message ,
28
- hash : commit . id ,
29
- } ) )
25
+ const getPushEventCommits = async ( ) => {
26
+ const octokit = getOctokit ( getInput ( 'token' ) )
27
+ const { owner, repo } = eventContext . issue
28
+ const { before, after } = eventContext . payload
29
+ const { data : comparison } = await octokit . rest . repos . compareCommits ( {
30
+ owner,
31
+ repo,
32
+ head : after ,
33
+ base : before ,
34
+ per_page : 100 ,
35
+ } )
30
36
31
- return mappedCommits
37
+ return comparison . commits . map ( ( commit ) => ( {
38
+ message : commit . commit . message ,
39
+ hash : commit . sha ,
40
+ } ) )
32
41
}
33
42
34
43
const getPullRequestEventCommits = async ( ) => {
You can’t perform that action at this time.
0 commit comments