forgejo-hooks: Add support for Issue

Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
pep 2024-09-04 20:26:27 +02:00
commit a6195d68de
3 changed files with 307 additions and 32 deletions

View file

@ -13,7 +13,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::{Hook, Push};
use crate::{Hook, Issue, Push};
use serde::Deserialize;
/// Deserializes the payload into a struct
@ -52,3 +52,9 @@ fn push_payload() {
let payload = std::fs::read_to_string("src/tests/push.json").unwrap();
let _ = parse_roundtrip::<Push>(&payload);
}
#[test]
fn issue_opened_payload() {
let payload = std::fs::read_to_string("src/tests/issue.json").unwrap();
let _ = parse_roundtrip::<Issue>(&payload);
}