From 56aa4b3b408e1e1b1d2d85ed4d643eb741f7adb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bouchex=20Bellomi=C3=A9?= Date: Thu, 3 Oct 2024 14:24:24 +0200 Subject: [PATCH] #1965 Adding delete method --- src/main/java/org/kohsuke/github/GHDeployment.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHDeployment.java b/src/main/java/org/kohsuke/github/GHDeployment.java index ae1858066..277e4e15f 100644 --- a/src/main/java/org/kohsuke/github/GHDeployment.java +++ b/src/main/java/org/kohsuke/github/GHDeployment.java @@ -194,6 +194,16 @@ public String getSha() { return sha; } + /** + * Deletes this deployment. + * + * @throws IOException + * the io exception + */ + public void delete() throws IOException { + root().createRequest().method("DELETE").withUrlPath(owner.getApiTailUrl("deployments/" + getId())).send(); + } + /** * Create status gh deployment status builder. *