Repository: hub4j/github-api
Pull request #1087 (2021-04-10 10:56:23)

Add label payload
# Description 

Add the label payload that is currently missing. Need it to forcefully apply some colors for a particular label prefix.

Also added some missing javadoc for `GHEventPayload.WorkflowRun` in a separate commit.

# Before submitting a PR:
We love getting PRs, but we hate asking people for the same basic changes every time. 

- [X] Push your changes to a branch other than `master`. Create your PR from that branch.    
- [X] Add JavaDocs and other comments
- [X] Write tests that run and pass in CI. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to capture snapshot data.
- [X] Run `mvn -D enable-ci clean install site` locally. If this command doesn't succeed, your change will not pass CI. 

# When creating a PR: 

- [X] Fill in the "Description" above. 
- [X] Enable "Allow edits from maintainers". 



Patch:
diff --git a/src/main/java/org/kohsuke/github/GHEventPayload.java b/src/main/java/org/kohsuke/github/GHEventPayload.java
index dc6f7bc63..68aeddd51 100644
--- a/src/main/java/org/kohsuke/github/GHEventPayload.java
+++ b/src/main/java/org/kohsuke/github/GHEventPayload.java
@@ -1384,10 +1384,20 @@ public class GHEventPayload extends GitHubInteractiveObject {
         private GHWorkflowRun workflowRun;
         private GHWorkflow workflow;
 
+        /**
+         * Gets the workflow run.
+         *
+         * @return the workflow run
+         */
         public GHWorkflowRun getWorkflowRun() {
             return workflowRun;
         }
 
+        /**
+         * Gets the associated workflow.
+         *
+         * @return the associated workflow
+         */
         public GHWorkflow getWorkflow() {
             return workflow;
         }
@@ -1407,4 +1417,35 @@ public class GHEventPayload extends GitHubInteractiveObject {
             workflow.wrapUp(repository);
         }
     }
+
+    /**
+     * A label was created, edited or deleted.
+     *
+     * @see <a href= "https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#label">
+     *      label event</a>
+     */
+    public static class Label extends GHEventPayload {
+
+        private GHLabel label;
+
+        private GHLabelChanges changes;
+
+        /**
+         * Gets the label.
+         *
+         * @return the label
+         */
+        public GHLabel getLabel() {
+            return label;
+        }
+
+        /**
+         * Gets changes (for action="edited")
+         *
+         * @return changes
+         */
+        public GHLabelChanges getChanges() {
+            return changes;
+        }
+    }
 }
diff --git a/src/main/java/org/kohsuke/github/GHLabelChanges.java b/src/main/java/org/kohsuke/github/GHLabelChanges.java
new file mode 100644
index 000000000..b3f5c8cfd
--- /dev/null
+++ b/src/main/java/org/kohsuke/github/GHLabelChanges.java
@@ -0,0 +1,49 @@
+package org.kohsuke.github;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+/**
+ * Wrapper to define changed fields on label action="edited"
+ *
+ * @see GHEventPayload.Label
+ */
+@SuppressFBWarnings("UWF_UNWRITTEN_FIELD")
+public class GHLabelChanges {
+
+    private GHFrom name;
+    private GHFrom color;
+
+    /**
+     * Old label name.
+     *
+     * @return old label name (or null if not changed)
+     */
+    public GHFrom getName() {
+        return name;
+    }
+
+    /**
+     * Old label color.
+     *
+     * @return old label color (or null if not changed)
+     */
+    public GHFrom getColor() {
+        return color;
+    }
+
+    /**
+     * Wrapper for changed values.
+     */
+    public static class GHFrom {
+        private String from;
+
+        /**
+         * Previous value that was changed.
+         *
+         * @return previous value
+         */
+        public String getFrom() {
+            return from;
+        }
+    }
+}


Test patch:
diff --git a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java
index 6adb4e75e..81b3270a9 100644
--- a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java
+++ b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java
@@ -805,4 +805,55 @@ public class GHEventPayloadTest extends AbstractGitHubWireMockTest {
         assertThat(workflowRun.getHeadRepository().getFullName(),
                 is("gsmet-bot-playground/quarkus-bot-java-playground"));
     }
+
+    @Test
+    public void label_created() throws Exception {
+        GHEventPayload.Label labelPayload = GitHub.offline()
+                .parseEventPayload(payload.asReader(), GHEventPayload.Label.class);
+        GHLabel label = labelPayload.getLabel();
+
+        assertThat(labelPayload.getAction(), is("created"));
+        assertThat(labelPayload.getRepository().getFullName(), is("gsmet/quarkus-bot-java-playground"));
+        assertThat(label.getId(), is(2901546662L));
+        assertThat(label.getNodeId(), is("MDU6TGFiZWwyOTAxNTQ2NjYy"));
+        assertThat(label.getName(), is("new-label"));
+        assertThat(label.getColor(), is("f9d0c4"));
+        assertThat(label.isDefault(), is(false));
+        assertThat(label.getDescription(), is("description"));
+    }
+
+    @Test
+    public void label_edited() throws Exception {
+        GHEventPayload.Label labelPayload = GitHub.offline()
+                .parseEventPayload(payload.asReader(), GHEventPayload.Label.class);
+        GHLabel label = labelPayload.getLabel();
+
+        assertThat(labelPayload.getAction(), is("edited"));
+        assertThat(labelPayload.getRepository().getFullName(), is("gsmet/quarkus-bot-java-playground"));
+        assertThat(label.getId(), is(2901546662L));
+        assertThat(label.getNodeId(), is("MDU6TGFiZWwyOTAxNTQ2NjYy"));
+        assertThat(label.getName(), is("new-label-updated"));
+        assertThat(label.getColor(), is("4AE686"));
+        assertThat(label.isDefault(), is(false));
+        assertThat(label.getDescription(), is("description"));
+
+        assertThat(labelPayload.getChanges().getName().getFrom(), is("new-label"));
+        assertThat(labelPayload.getChanges().getColor().getFrom(), is("f9d0c4"));
+    }
+
+    @Test
+    public void label_deleted() throws Exception {
+        GHEventPayload.Label labelPayload = GitHub.offline()
+                .parseEventPayload(payload.asReader(), GHEventPayload.Label.class);
+        GHLabel label = labelPayload.getLabel();
+
+        assertThat(labelPayload.getAction(), is("deleted"));
+        assertThat(labelPayload.getRepository().getFullName(), is("gsmet/quarkus-bot-java-playground"));
+        assertThat(label.getId(), is(2901546662L));
+        assertThat(label.getNodeId(), is("MDU6TGFiZWwyOTAxNTQ2NjYy"));
+        assertThat(label.getName(), is("new-label-updated"));
+        assertThat(label.getColor(), is("4AE686"));
+        assertThat(label.isDefault(), is(false));
+        assertThat(label.getDescription(), is("description"));
+    }
 }
diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/label_created.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/label_created.json
new file mode 100644
index 000000000..ff197e2ad
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/label_created.json
@@ -0,0 +1,130 @@
+{
+  "action": "created",
+  "label": {
+    "id": 2901546662,
+    "node_id": "MDU6TGFiZWwyOTAxNTQ2NjYy",
+    "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels/new-label",
+    "name": "new-label",
+    "color": "f9d0c4",
+    "default": false,
+    "description": "description"
+  },
+  "repository": {
+    "id": 313384129,
+    "node_id": "MDEwOlJlcG9zaXRvcnkzMTMzODQxMjk=",
+    "name": "quarkus-bot-java-playground",
+    "full_name": "gsmet/quarkus-bot-java-playground",
+    "private": false,
+    "owner": {
+      "login": "gsmet",
+      "id": 1279749,
+      "node_id": "MDQ6VXNlcjEyNzk3NDk=",
+      "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4",
+      "gravatar_id": "",
+      "url": "https://api.github.com/users/gsmet",
+      "html_url": "https://github.com/gsmet",
+      "followers_url": "https://api.github.com/users/gsmet/followers",
+      "following_url": "https://api.github.com/users/gsmet/following{/other_user}",
+      "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}",
+      "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}",
+      "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions",
+      "organizations_url": "https://api.github.com/users/gsmet/orgs",
+      "repos_url": "https://api.github.com/users/gsmet/repos",
+      "events_url": "https://api.github.com/users/gsmet/events{/privacy}",
+      "received_events_url": "https://api.github.com/users/gsmet/received_events",
+      "type": "User",
+      "site_admin": false
+    },
+    "html_url": "https://github.com/gsmet/quarkus-bot-java-playground",
+    "description": null,
+    "fork": false,
+    "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground",
+    "forks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/forks",
+    "keys_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/keys{/key_id}",
+    "collaborators_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/collaborators{/collaborator}",
+    "teams_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/teams",
+    "hooks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/hooks",
+    "issue_events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/events{/number}",
+    "events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/events",
+    "assignees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/assignees{/user}",
+    "branches_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/branches{/branch}",
+    "tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/tags",
+    "blobs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/blobs{/sha}",
+    "git_tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/tags{/sha}",
+    "git_refs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/refs{/sha}",
+    "trees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/trees{/sha}",
+    "statuses_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/statuses/{sha}",
+    "languages_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/languages",
+    "stargazers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/stargazers",
+    "contributors_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contributors",
+    "subscribers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscribers",
+    "subscription_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscription",
+    "commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/commits{/sha}",
+    "git_commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/commits{/sha}",
+    "comments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/comments{/number}",
+    "issue_comment_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/comments{/number}",
+    "contents_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contents/{+path}",
+    "compare_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/compare/{base}...{head}",
+    "merges_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/merges",
+    "archive_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/{archive_format}{/ref}",
+    "downloads_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/downloads",
+    "issues_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues{/number}",
+    "pulls_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/pulls{/number}",
+    "milestones_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/milestones{/number}",
+    "notifications_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/notifications{?since,all,participating}",
+    "labels_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels{/name}",
+    "releases_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/releases{/id}",
+    "deployments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/deployments",
+    "created_at": "2020-11-16T17:55:53Z",
+    "updated_at": "2021-04-06T17:25:43Z",
+    "pushed_at": "2021-04-09T17:46:23Z",
+    "git_url": "git://github.com/gsmet/quarkus-bot-java-playground.git",
+    "ssh_url": "git@github.com:gsmet/quarkus-bot-java-playground.git",
+    "clone_url": "https://github.com/gsmet/quarkus-bot-java-playground.git",
+    "svn_url": "https://github.com/gsmet/quarkus-bot-java-playground",
+    "homepage": null,
+    "size": 42,
+    "stargazers_count": 0,
+    "watchers_count": 0,
+    "language": "Java",
+    "has_issues": true,
+    "has_projects": true,
+    "has_downloads": true,
+    "has_wiki": true,
+    "has_pages": false,
+    "forks_count": 1,
+    "mirror_url": null,
+    "archived": false,
+    "disabled": false,
+    "open_issues_count": 31,
+    "license": null,
+    "forks": 1,
+    "open_issues": 31,
+    "watchers": 0,
+    "default_branch": "main"
+  },
+  "sender": {
+    "login": "gsmet",
+    "id": 1279749,
+    "node_id": "MDQ6VXNlcjEyNzk3NDk=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/gsmet",
+    "html_url": "https://github.com/gsmet",
+    "followers_url": "https://api.github.com/users/gsmet/followers",
+    "following_url": "https://api.github.com/users/gsmet/following{/other_user}",
+    "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions",
+    "organizations_url": "https://api.github.com/users/gsmet/orgs",
+    "repos_url": "https://api.github.com/users/gsmet/repos",
+    "events_url": "https://api.github.com/users/gsmet/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/gsmet/received_events",
+    "type": "User",
+    "site_admin": false
+  },
+  "installation": {
+    "id": 13005535,
+    "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTMwMDU1MzU="
+  }
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/label_deleted.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/label_deleted.json
new file mode 100644
index 000000000..1f1dbc428
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/label_deleted.json
@@ -0,0 +1,130 @@
+{
+  "action": "deleted",
+  "label": {
+    "id": 2901546662,
+    "node_id": "MDU6TGFiZWwyOTAxNTQ2NjYy",
+    "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels/new-label-updated",
+    "name": "new-label-updated",
+    "color": "4AE686",
+    "default": false,
+    "description": "description"
+  },
+  "repository": {
+    "id": 313384129,
+    "node_id": "MDEwOlJlcG9zaXRvcnkzMTMzODQxMjk=",
+    "name": "quarkus-bot-java-playground",
+    "full_name": "gsmet/quarkus-bot-java-playground",
+    "private": false,
+    "owner": {
+      "login": "gsmet",
+      "id": 1279749,
+      "node_id": "MDQ6VXNlcjEyNzk3NDk=",
+      "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4",
+      "gravatar_id": "",
+      "url": "https://api.github.com/users/gsmet",
+      "html_url": "https://github.com/gsmet",
+      "followers_url": "https://api.github.com/users/gsmet/followers",
+      "following_url": "https://api.github.com/users/gsmet/following{/other_user}",
+      "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}",
+      "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}",
+      "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions",
+      "organizations_url": "https://api.github.com/users/gsmet/orgs",
+      "repos_url": "https://api.github.com/users/gsmet/repos",
+      "events_url": "https://api.github.com/users/gsmet/events{/privacy}",
+      "received_events_url": "https://api.github.com/users/gsmet/received_events",
+      "type": "User",
+      "site_admin": false
+    },
+    "html_url": "https://github.com/gsmet/quarkus-bot-java-playground",
+    "description": null,
+    "fork": false,
+    "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground",
+    "forks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/forks",
+    "keys_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/keys{/key_id}",
+    "collaborators_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/collaborators{/collaborator}",
+    "teams_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/teams",
+    "hooks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/hooks",
+    "issue_events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/events{/number}",
+    "events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/events",
+    "assignees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/assignees{/user}",
+    "branches_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/branches{/branch}",
+    "tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/tags",
+    "blobs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/blobs{/sha}",
+    "git_tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/tags{/sha}",
+    "git_refs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/refs{/sha}",
+    "trees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/trees{/sha}",
+    "statuses_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/statuses/{sha}",
+    "languages_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/languages",
+    "stargazers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/stargazers",
+    "contributors_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contributors",
+    "subscribers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscribers",
+    "subscription_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscription",
+    "commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/commits{/sha}",
+    "git_commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/commits{/sha}",
+    "comments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/comments{/number}",
+    "issue_comment_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/comments{/number}",
+    "contents_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contents/{+path}",
+    "compare_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/compare/{base}...{head}",
+    "merges_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/merges",
+    "archive_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/{archive_format}{/ref}",
+    "downloads_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/downloads",
+    "issues_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues{/number}",
+    "pulls_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/pulls{/number}",
+    "milestones_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/milestones{/number}",
+    "notifications_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/notifications{?since,all,participating}",
+    "labels_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels{/name}",
+    "releases_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/releases{/id}",
+    "deployments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/deployments",
+    "created_at": "2020-11-16T17:55:53Z",
+    "updated_at": "2021-04-06T17:25:43Z",
+    "pushed_at": "2021-04-09T17:46:23Z",
+    "git_url": "git://github.com/gsmet/quarkus-bot-java-playground.git",
+    "ssh_url": "git@github.com:gsmet/quarkus-bot-java-playground.git",
+    "clone_url": "https://github.com/gsmet/quarkus-bot-java-playground.git",
+    "svn_url": "https://github.com/gsmet/quarkus-bot-java-playground",
+    "homepage": null,
+    "size": 42,
+    "stargazers_count": 0,
+    "watchers_count": 0,
+    "language": "Java",
+    "has_issues": true,
+    "has_projects": true,
+    "has_downloads": true,
+    "has_wiki": true,
+    "has_pages": false,
+    "forks_count": 1,
+    "mirror_url": null,
+    "archived": false,
+    "disabled": false,
+    "open_issues_count": 31,
+    "license": null,
+    "forks": 1,
+    "open_issues": 31,
+    "watchers": 0,
+    "default_branch": "main"
+  },
+  "sender": {
+    "login": "gsmet",
+    "id": 1279749,
+    "node_id": "MDQ6VXNlcjEyNzk3NDk=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/gsmet",
+    "html_url": "https://github.com/gsmet",
+    "followers_url": "https://api.github.com/users/gsmet/followers",
+    "following_url": "https://api.github.com/users/gsmet/following{/other_user}",
+    "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions",
+    "organizations_url": "https://api.github.com/users/gsmet/orgs",
+    "repos_url": "https://api.github.com/users/gsmet/repos",
+    "events_url": "https://api.github.com/users/gsmet/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/gsmet/received_events",
+    "type": "User",
+    "site_admin": false
+  },
+  "installation": {
+    "id": 13005535,
+    "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTMwMDU1MzU="
+  }
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/label_edited.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/label_edited.json
new file mode 100644
index 000000000..ca13b1ee7
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/label_edited.json
@@ -0,0 +1,138 @@
+{
+  "action": "edited",
+  "label": {
+    "id": 2901546662,
+    "node_id": "MDU6TGFiZWwyOTAxNTQ2NjYy",
+    "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels/new-label-updated",
+    "name": "new-label-updated",
+    "color": "4AE686",
+    "default": false,
+    "description": "description"
+  },
+  "changes": {
+    "name": {
+      "from": "new-label"
+    },
+    "color": {
+      "from": "f9d0c4"
+    }
+  },
+  "repository": {
+    "id": 313384129,
+    "node_id": "MDEwOlJlcG9zaXRvcnkzMTMzODQxMjk=",
+    "name": "quarkus-bot-java-playground",
+    "full_name": "gsmet/quarkus-bot-java-playground",
+    "private": false,
+    "owner": {
+      "login": "gsmet",
+      "id": 1279749,
+      "node_id": "MDQ6VXNlcjEyNzk3NDk=",
+      "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4",
+      "gravatar_id": "",
+      "url": "https://api.github.com/users/gsmet",
+      "html_url": "https://github.com/gsmet",
+      "followers_url": "https://api.github.com/users/gsmet/followers",
+      "following_url": "https://api.github.com/users/gsmet/following{/other_user}",
+      "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}",
+      "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}",
+      "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions",
+      "organizations_url": "https://api.github.com/users/gsmet/orgs",
+      "repos_url": "https://api.github.com/users/gsmet/repos",
+      "events_url": "https://api.github.com/users/gsmet/events{/privacy}",
+      "received_events_url": "https://api.github.com/users/gsmet/received_events",
+      "type": "User",
+      "site_admin": false
+    },
+    "html_url": "https://github.com/gsmet/quarkus-bot-java-playground",
+    "description": null,
+    "fork": false,
+    "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground",
+    "forks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/forks",
+    "keys_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/keys{/key_id}",
+    "collaborators_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/collaborators{/collaborator}",
+    "teams_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/teams",
+    "hooks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/hooks",
+    "issue_events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/events{/number}",
+    "events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/events",
+    "assignees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/assignees{/user}",
+    "branches_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/branches{/branch}",
+    "tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/tags",
+    "blobs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/blobs{/sha}",
+    "git_tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/tags{/sha}",
+    "git_refs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/refs{/sha}",
+    "trees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/trees{/sha}",
+    "statuses_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/statuses/{sha}",
+    "languages_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/languages",
+    "stargazers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/stargazers",
+    "contributors_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contributors",
+    "subscribers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscribers",
+    "subscription_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscription",
+    "commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/commits{/sha}",
+    "git_commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/commits{/sha}",
+    "comments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/comments{/number}",
+    "issue_comment_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/comments{/number}",
+    "contents_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contents/{+path}",
+    "compare_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/compare/{base}...{head}",
+    "merges_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/merges",
+    "archive_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/{archive_format}{/ref}",
+    "downloads_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/downloads",
+    "issues_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues{/number}",
+    "pulls_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/pulls{/number}",
+    "milestones_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/milestones{/number}",
+    "notifications_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/notifications{?since,all,participating}",
+    "labels_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels{/name}",
+    "releases_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/releases{/id}",
+    "deployments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/deployments",
+    "created_at": "2020-11-16T17:55:53Z",
+    "updated_at": "2021-04-06T17:25:43Z",
+    "pushed_at": "2021-04-09T17:46:23Z",
+    "git_url": "git://github.com/gsmet/quarkus-bot-java-playground.git",
+    "ssh_url": "git@github.com:gsmet/quarkus-bot-java-playground.git",
+    "clone_url": "https://github.com/gsmet/quarkus-bot-java-playground.git",
+    "svn_url": "https://github.com/gsmet/quarkus-bot-java-playground",
+    "homepage": null,
+    "size": 42,
+    "stargazers_count": 0,
+    "watchers_count": 0,
+    "language": "Java",
+    "has_issues": true,
+    "has_projects": true,
+    "has_downloads": true,
+    "has_wiki": true,
+    "has_pages": false,
+    "forks_count": 1,
+    "mirror_url": null,
+    "archived": false,
+    "disabled": false,
+    "open_issues_count": 31,
+    "license": null,
+    "forks": 1,
+    "open_issues": 31,
+    "watchers": 0,
+    "default_branch": "main"
+  },
+  "sender": {
+    "login": "gsmet",
+    "id": 1279749,
+    "node_id": "MDQ6VXNlcjEyNzk3NDk=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/gsmet",
+    "html_url": "https://github.com/gsmet",
+    "followers_url": "https://api.github.com/users/gsmet/followers",
+    "following_url": "https://api.github.com/users/gsmet/following{/other_user}",
+    "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions",
+    "organizations_url": "https://api.github.com/users/gsmet/orgs",
+    "repos_url": "https://api.github.com/users/gsmet/repos",
+    "events_url": "https://api.github.com/users/gsmet/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/gsmet/received_events",
+    "type": "User",
+    "site_admin": false
+  },
+  "installation": {
+    "id": 13005535,
+    "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTMwMDU1MzU="
+  }
+}
\ No newline at end of file