forgejo-hooks: Add support for issue comments

Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
pep 2025-05-03 17:32:31 +02:00
commit 96353016d4
No known key found for this signature in database
GPG key ID: DEDA74AEECA9D0F2
3 changed files with 248 additions and 1 deletions

View file

@ -201,6 +201,7 @@ pub struct RemovedBranch {
#[derive(Deserialize, Debug, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum IssueAction {
Created,
Opened,
Edited,
}
@ -261,13 +262,29 @@ pub struct IssueAttrs {
pub pin_order: u32,
}
#[derive(Deserialize, Debug, PartialEq)]
pub struct Comment {
pub id: u64,
pub html_url: String,
pub pull_request_url: String,
pub issue_url: String,
pub user: User,
pub original_author: String,
pub original_author_id: u64,
pub body: String,
pub assets: Vec<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}
#[derive(Deserialize, Debug, PartialEq)]
pub struct Issue {
pub action: IssueAction,
pub number: u64,
pub changes: Option<Changes>,
pub issue: IssueAttrs,
pub comment: Option<Comment>,
pub repository: Repository,
pub is_pull: Option<bool>,
}
impl From<Push> for Hook {