Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bd89f18

Browse filesBrowse files
authored
Merge branch 'main' into add-workflowjob-labels
2 parents 1d41b8b + 4e103a6 commit bd89f18
Copy full SHA for bd89f18

File tree

Expand file treeCollapse file tree

3 files changed

+158
-0
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+158
-0
lines changed

‎src/main/java/org/kohsuke/github/GHEventPayload.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHEventPayload.java
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,4 +1572,25 @@ public GHLabel getLabel() {
15721572
return label;
15731573
}
15741574
}
1575+
1576+
/**
1577+
* A star was created or deleted on a repository.
1578+
*
1579+
* @see <a href=
1580+
* "https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#star">star
1581+
* event</a>
1582+
*/
1583+
public static class Star extends GHEventPayload {
1584+
1585+
private String starredAt;
1586+
1587+
/**
1588+
* Gets the date when the star is added. Is null when the star is deleted.
1589+
*
1590+
* @return the date when the star is added
1591+
*/
1592+
public Date getStarredAt() {
1593+
return GitHubClient.parseDate(starredAt);
1594+
}
1595+
}
15751596
}

‎src/test/java/org/kohsuke/github/GHEventPayloadTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/GHEventPayloadTest.java
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,4 +1097,15 @@ public void discussion_labeled() throws Exception {
10971097
assertThat(label.isDefault(), is(false));
10981098
assertThat(label.getDescription(), is(nullValue()));
10991099
}
1100+
1101+
@Test
1102+
public void starred() throws Exception {
1103+
final GHEventPayload.Star starPayload = GitHub.offline()
1104+
.parseEventPayload(payload.asReader(), GHEventPayload.Star.class);
1105+
1106+
assertThat(starPayload.getAction(), is("created"));
1107+
assertThat(starPayload.getRepository().getFullName(), is("gsmet/quarkus-bot-java-playground"));
1108+
assertThat(starPayload.getSender().getLogin(), is("gsmet"));
1109+
assertThat(starPayload.getStarredAt().getTime(), is(1654017876000L));
1110+
}
11001111
}
+126Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"action": "created",
3+
"starred_at": "2022-05-31T17:24:36Z",
4+
"repository": {
5+
"id": 313384129,
6+
"node_id": "MDEwOlJlcG9zaXRvcnkzMTMzODQxMjk=",
7+
"name": "quarkus-bot-java-playground",
8+
"full_name": "gsmet/quarkus-bot-java-playground",
9+
"private": false,
10+
"owner": {
11+
"login": "gsmet",
12+
"id": 1279749,
13+
"node_id": "MDQ6VXNlcjEyNzk3NDk=",
14+
"avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4",
15+
"gravatar_id": "",
16+
"url": "https://api.github.com/users/gsmet",
17+
"html_url": "https://github.com/gsmet",
18+
"followers_url": "https://api.github.com/users/gsmet/followers",
19+
"following_url": "https://api.github.com/users/gsmet/following{/other_user}",
20+
"gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}",
21+
"starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}",
22+
"subscriptions_url": "https://api.github.com/users/gsmet/subscriptions",
23+
"organizations_url": "https://api.github.com/users/gsmet/orgs",
24+
"repos_url": "https://api.github.com/users/gsmet/repos",
25+
"events_url": "https://api.github.com/users/gsmet/events{/privacy}",
26+
"received_events_url": "https://api.github.com/users/gsmet/received_events",
27+
"type": "User",
28+
"site_admin": false
29+
},
30+
"html_url": "https://github.com/gsmet/quarkus-bot-java-playground",
31+
"description": null,
32+
"fork": false,
33+
"url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground",
34+
"forks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/forks",
35+
"keys_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/keys{/key_id}",
36+
"collaborators_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/collaborators{/collaborator}",
37+
"teams_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/teams",
38+
"hooks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/hooks",
39+
"issue_events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/events{/number}",
40+
"events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/events",
41+
"assignees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/assignees{/user}",
42+
"branches_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/branches{/branch}",
43+
"tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/tags",
44+
"blobs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/blobs{/sha}",
45+
"git_tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/tags{/sha}",
46+
"git_refs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/refs{/sha}",
47+
"trees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/trees{/sha}",
48+
"statuses_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/statuses/{sha}",
49+
"languages_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/languages",
50+
"stargazers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/stargazers",
51+
"contributors_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contributors",
52+
"subscribers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscribers",
53+
"subscription_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscription",
54+
"commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/commits{/sha}",
55+
"git_commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/commits{/sha}",
56+
"comments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/comments{/number}",
57+
"issue_comment_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/comments{/number}",
58+
"contents_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contents/{+path}",
59+
"compare_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/compare/{base}...{head}",
60+
"merges_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/merges",
61+
"archive_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/{archive_format}{/ref}",
62+
"downloads_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/downloads",
63+
"issues_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues{/number}",
64+
"pulls_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/pulls{/number}",
65+
"milestones_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/milestones{/number}",
66+
"notifications_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/notifications{?since,all,participating}",
67+
"labels_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels{/name}",
68+
"releases_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/releases{/id}",
69+
"deployments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/deployments",
70+
"created_at": "2020-11-16T17:55:53Z",
71+
"updated_at": "2022-05-31T17:24:36Z",
72+
"pushed_at": "2022-05-30T10:55:11Z",
73+
"git_url": "git://github.com/gsmet/quarkus-bot-java-playground.git",
74+
"ssh_url": "git@github.com:gsmet/quarkus-bot-java-playground.git",
75+
"clone_url": "https://github.com/gsmet/quarkus-bot-java-playground.git",
76+
"svn_url": "https://github.com/gsmet/quarkus-bot-java-playground",
77+
"homepage": null,
78+
"size": 89,
79+
"stargazers_count": 1,
80+
"watchers_count": 1,
81+
"language": "Java",
82+
"has_issues": true,
83+
"has_projects": true,
84+
"has_downloads": true,
85+
"has_wiki": true,
86+
"has_pages": false,
87+
"forks_count": 2,
88+
"mirror_url": null,
89+
"archived": false,
90+
"disabled": false,
91+
"open_issues_count": 36,
92+
"license": null,
93+
"allow_forking": true,
94+
"is_template": false,
95+
"topics": [],
96+
"visibility": "public",
97+
"forks": 2,
98+
"open_issues": 36,
99+
"watchers": 1,
100+
"default_branch": "main"
101+
},
102+
"sender": {
103+
"login": "gsmet",
104+
"id": 1279749,
105+
"node_id": "MDQ6VXNlcjEyNzk3NDk=",
106+
"avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4",
107+
"gravatar_id": "",
108+
"url": "https://api.github.com/users/gsmet",
109+
"html_url": "https://github.com/gsmet",
110+
"followers_url": "https://api.github.com/users/gsmet/followers",
111+
"following_url": "https://api.github.com/users/gsmet/following{/other_user}",
112+
"gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}",
113+
"starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}",
114+
"subscriptions_url": "https://api.github.com/users/gsmet/subscriptions",
115+
"organizations_url": "https://api.github.com/users/gsmet/orgs",
116+
"repos_url": "https://api.github.com/users/gsmet/repos",
117+
"events_url": "https://api.github.com/users/gsmet/events{/privacy}",
118+
"received_events_url": "https://api.github.com/users/gsmet/received_events",
119+
"type": "User",
120+
"site_admin": false
121+
},
122+
"installation": {
123+
"id": 13005535,
124+
"node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTMwMDU1MzU="
125+
}
126+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.