Skip to content

Commit 72b9d03

Browse files
Merge pull request #28 from codefresh-plugins/CR-6758
CR-6758
2 parents 3c067a0 + 12e5dac commit 72b9d03

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-enricher",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"private": true,
55
"scripts": {
66
"start": "node src/index.js",

src/codefresh.api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class CodefreshAPI {
4949
},
5050
bigValue: {
5151
firstCommitDate: pullRequest.firstCommitDate,
52+
lastCommitDate: pullRequest.lastCommitDate,
5253
branch,
5354
commits: pullRequest.commits,
5455
}

src/pull-request/github/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class GithubApi {
1414

1515
const { branch, repo } = configuration;
1616
console.log(`Looking for PRs from ${repo} repo and ${branch} branch`);
17+
1718
const prs = await octokit.search.issuesAndPullRequests({ q: `head:${branch}+type:pr+repo:${repo}+is:open` });
1819
return Promise.all(prs.data.items.map(async (pr) => {
1920
const info = await githubApiCommon.extractCommitsInfo(pr.number);

src/pull-request/github/github.api.common.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class GithubApiCommon {
1616
const committersMap = {};
1717
const commitsByUser = {};
1818
let firstCommitDate;
19+
let lastCommitDate;
1920

2021
let page = 1;
2122
while (true) {
@@ -34,6 +35,8 @@ class GithubApiCommon {
3435
firstCommitDate = commits.data[0].commit.author.date;
3536
}
3637

38+
lastCommitDate = _.last(commits.data).commit.author.date;
39+
3740
for (const commit of commits.data) {
3841
if (!commit.author) {
3942
continue
@@ -70,6 +73,7 @@ class GithubApiCommon {
7073
committers: _.values(committersMap),
7174
commits: _.flatten(_.values(commitsByUser)),
7275
firstCommitDate,
76+
lastCommitDate
7377
};
7478
}
7579

0 commit comments

Comments
 (0)