mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-07-18 12:38:26 +02:00
project setup
This commit is contained in:
commit
05d156a5b0
39 changed files with 14823 additions and 0 deletions
19
src/service/git/github/github-mapper.ts
Normal file
19
src/service/git/github/github-mapper.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { GitPullRequest } from "@gb/service/git/git.types";
|
||||
import { PullRequest, User } from "@octokit/webhooks-types";
|
||||
|
||||
export default class GitHubMapper {
|
||||
|
||||
mapPullRequest(pr: PullRequest): GitPullRequest {
|
||||
return {
|
||||
url: pr.url,
|
||||
title: pr.title,
|
||||
body: pr.body,
|
||||
patchUrl: pr.patch_url,
|
||||
state: pr.state,
|
||||
reviewers: pr.requested_reviewers.filter(r => "login" in r).map((r => (r as User)?.login)),
|
||||
sourceRepo: pr.head.repo.full_name,
|
||||
targetRepo: pr.base.repo.full_name,
|
||||
commits: [pr.merge_commit_sha]
|
||||
} as GitPullRequest;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue