File tree 4 files changed +7
-1
lines changed 4 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " github-enricher" ,
3
- "version" : " 1.0.7 " ,
3
+ "version" : " 1.0.8 " ,
4
4
"private" : true ,
5
5
"scripts" : {
6
6
"start" : " node src/index.js" ,
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ class CodefreshAPI {
49
49
} ,
50
50
bigValue : {
51
51
firstCommitDate : pullRequest . firstCommitDate ,
52
+ lastCommitDate : pullRequest . lastCommitDate ,
52
53
branch,
53
54
commits : pullRequest . commits ,
54
55
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ class GithubApi {
14
14
15
15
const { branch, repo } = configuration ;
16
16
console . log ( `Looking for PRs from ${ repo } repo and ${ branch } branch` ) ;
17
+
17
18
const prs = await octokit . search . issuesAndPullRequests ( { q : `head:${ branch } +type:pr+repo:${ repo } +is:open` } ) ;
18
19
return Promise . all ( prs . data . items . map ( async ( pr ) => {
19
20
const info = await githubApiCommon . extractCommitsInfo ( pr . number ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class GithubApiCommon {
16
16
const committersMap = { } ;
17
17
const commitsByUser = { } ;
18
18
let firstCommitDate ;
19
+ let lastCommitDate ;
19
20
20
21
let page = 1 ;
21
22
while ( true ) {
@@ -34,6 +35,8 @@ class GithubApiCommon {
34
35
firstCommitDate = commits . data [ 0 ] . commit . author . date ;
35
36
}
36
37
38
+ lastCommitDate = _ . last ( commits . data ) . commit . author . date ;
39
+
37
40
for ( const commit of commits . data ) {
38
41
if ( ! commit . author ) {
39
42
continue
@@ -70,6 +73,7 @@ class GithubApiCommon {
70
73
committers : _ . values ( committersMap ) ,
71
74
commits : _ . flatten ( _ . values ( commitsByUser ) ) ,
72
75
firstCommitDate,
76
+ lastCommitDate
73
77
} ;
74
78
}
75
79
You can’t perform that action at this time.
0 commit comments