Skip to content

Commit

Permalink
Add post author for GitHub and Bitbucket backends
Browse files Browse the repository at this point in the history
  • Loading branch information
reshmar committed Sep 9, 2021
1 parent 92584e1 commit fafe278
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/netlify-cms-backend-bitbucket/src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type BitBucketPullRequest = {
name: string;
};
};
author: BitBucketUser;
};

type BitBucketPullRequests = {
Expand Down Expand Up @@ -699,6 +700,7 @@ export default class API {
const label = await this.getPullRequestLabel(pullRequest.id);
const status = labelToStatus(label, this.cmsLabelPrefix);
const updatedAt = pullRequest.updated_on;
const pullRequestAuthor = pullRequest.author.nickname;
return {
collection,
slug,
Expand All @@ -708,6 +710,7 @@ export default class API {
.filter(d => d.status !== 'deleted')
.map(d => ({ path: d.path, newFile: d.newFile, id: '' })),
updatedAt,
pullRequestAuthor,
};
}

Expand Down
2 changes: 2 additions & 0 deletions packages/netlify-cms-backend-gitlab/src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,14 @@ export default class API {
const label = mergeRequest.labels.find(l => isCMSLabel(l, this.cmsLabelPrefix)) as string;
const status = labelToStatus(label, this.cmsLabelPrefix);
const updatedAt = mergeRequest.updated_at;
const pullRequestAuthor = mergeRequest.author.username;
return {
collection,
slug,
status,
diffs: diffsWithIds,
updatedAt,
pullRequestAuthor,
};
}

Expand Down

0 comments on commit fafe278

Please sign in to comment.