Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit f2073a4

Browse files
committed
get repository info
1 parent 9964081 commit f2073a4

File tree

5 files changed

+76
-29
lines changed

5 files changed

+76
-29
lines changed

Sources/Swoctokit/Models/Owner.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// Owner.swift
3+
// Swoctokit
4+
//
5+
// Created by Franz Busch on 14.11.18.
6+
//
7+
8+
import Foundation
9+
10+
11+
public struct Owner: Decodable {
12+
13+
public let login: String
14+
public let id: Int
15+
public let nodeId: String
16+
17+
private enum CodingKeys: String, CodingKey {
18+
case login
19+
case id
20+
case nodeId = "node_id"
21+
}
22+
23+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// PullRequest.swift
3+
// Swoctokit
4+
//
5+
// Created by Franz Busch on 14.11.18.
6+
//
7+
8+
import Foundation
9+
10+
public struct PullRequest: Decodable {
11+
12+
public struct Head: Decodable {
13+
14+
public let label: String
15+
public let ref: String
16+
public let sha: String
17+
public let repo: Repository
18+
}
19+
20+
public let id: Int
21+
public let number: Int
22+
public let state: String
23+
public let title: String
24+
public let body: String
25+
public let head: Head
26+
27+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// Repository.swift
3+
// Swoctokit
4+
//
5+
// Created by Franz Busch on 14.11.18.
6+
//
7+
8+
import Foundation
9+
10+
public struct Repository: Decodable {
11+
12+
public let id: Int
13+
public let nodeId: String
14+
public let name: String
15+
public let fullName: String
16+
public let owner: Owner
17+
18+
private enum CodingKeys: String, CodingKey {
19+
case id
20+
case nodeId = "node_id"
21+
case name
22+
case fullName = "full_name"
23+
case owner
24+
}
25+
}

Sources/Swoctokit/Webhook/IssueCommentEvent.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public struct IssueCommentEvent: Decodable, WebhookEvent {
1111

1212
public let action: String
1313
public let issue: Issue
14+
public let repository: Repository
1415

1516
}
1617

Sources/Swoctokit/Webhook/PullRequestEvent.swift

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,4 @@ public struct PullRequestEvent: Decodable, WebhookEvent {
1919

2020
}
2121

22-
public struct PullRequest: Decodable {
2322

24-
public struct Head: Decodable {
25-
26-
public struct Repo: Decodable {
27-
public let id: Int
28-
public let name: String
29-
public let fullName: String
30-
31-
private enum CodingKeys: String, CodingKey {
32-
case id
33-
case name
34-
case fullName = "full_name"
35-
}
36-
}
37-
38-
public let label: String
39-
public let ref: String
40-
public let sha: String
41-
public let repo: Repo
42-
}
43-
44-
public let id: Int
45-
public let number: Int
46-
public let state: String
47-
public let title: String
48-
public let body: String
49-
public let head: Head
50-
51-
}

0 commit comments

Comments
 (0)