Add webhook already handled check
Fix all tests Add woodpecker ci (tests + release)
This commit is contained in:
1 parent
3c32cd20b6
commit
433021d607
13 files changed
+221
-17
No files matched your search
+38
-5
@@ -158,6 +158,14 @@ pub enum WebhookType {
|
||||
Review(ReviewPayload),
|
||||
}
|
||||
|
||||
impl WebhookType {
|
||||
pub fn event_id(&self) -> u64 {
|
||||
match self {
|
||||
WebhookType::Review(payload) => payload.comment.id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub struct ReviewPayload {
|
||||
pub action: String,
|
||||
@@ -229,7 +237,12 @@ mod tests {
|
||||
"action": "created",
|
||||
"pull_request": {
|
||||
"id": 42,
|
||||
"diff_url": "https://mydiff.fr"
|
||||
"diff_url": "https://mydiff.fr",
|
||||
"number": 1,
|
||||
"title": "My PR"
|
||||
},
|
||||
"repository": {
|
||||
"full_name": "owner/repo"
|
||||
},
|
||||
"comment": {
|
||||
"id": 7,
|
||||
@@ -288,7 +301,12 @@ mod tests {
|
||||
"action": "edited",
|
||||
"pull_request": {
|
||||
"id": 1,
|
||||
"diff_url": "https://mydiff.fr"
|
||||
"diff_url": "https://mydiff.fr",
|
||||
"number": 1,
|
||||
"title": "My PR"
|
||||
},
|
||||
"repository": {
|
||||
"full_name": "owner/repo"
|
||||
},
|
||||
"comment": {
|
||||
"id": 1,
|
||||
@@ -314,7 +332,12 @@ mod tests {
|
||||
"action": "created",
|
||||
"pull_request": {
|
||||
"id": 99,
|
||||
"diff_url": "https://mydiff.fr"
|
||||
"diff_url": "https://mydiff.fr",
|
||||
"number": 5,
|
||||
"title": "My PR"
|
||||
},
|
||||
"repository": {
|
||||
"full_name": "owner/repo"
|
||||
},
|
||||
"comment": {
|
||||
"id": 12,
|
||||
@@ -346,7 +369,12 @@ mod tests {
|
||||
"action": "created",
|
||||
"pull_request": {
|
||||
"id": 1,
|
||||
"diff_url": "https://mydiff.fr"
|
||||
"diff_url": "https://mydiff.fr",
|
||||
"number": 1,
|
||||
"title": "My PR"
|
||||
},
|
||||
"repository": {
|
||||
"full_name": "owner/repo"
|
||||
},
|
||||
"comment": {
|
||||
"id": 1,
|
||||
@@ -367,7 +395,12 @@ mod tests {
|
||||
"action": "created",
|
||||
"pull_request": {
|
||||
"id": 1,
|
||||
"diff_url": "https://mydiff.fr"
|
||||
"diff_url": "https://mydiff.fr",
|
||||
"number": 1,
|
||||
"title": "My PR"
|
||||
},
|
||||
"repository": {
|
||||
"full_name": "owner/repo"
|
||||
},
|
||||
"comment": {
|
||||
"id": 1,
|
||||
|
||||
Reference in new issue
Block a user