Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue_comment can also be on pull requests #8

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 0 additions & 256 deletions fixtures/comment_created.json

This file was deleted.

256 changes: 0 additions & 256 deletions fixtures/comment_deleted.json

This file was deleted.

256 changes: 256 additions & 0 deletions fixtures/issue_comment/created.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
{
"action": "created",
"issue": {
"url": "https://api.github.com/repos/catppuccin/java/issues/20",
"repository_url": "https://api.github.com/repos/catppuccin/java",
"labels_url": "https://api.github.com/repos/catppuccin/java/issues/20/labels{/name}",
"comments_url": "https://api.github.com/repos/catppuccin/java/issues/20/comments",
"events_url": "https://api.github.com/repos/catppuccin/java/issues/20/events",
"html_url": "https://github.com/catppuccin/java/issues/20",
"id": 2396591382,
"node_id": "I_kwDOIvYgYM6O2RUW",
"number": 20,
"title": "Reconsider OSSRH Authentication",
"user": {
"login": "sgoudham",
"id": 58985301,
"node_id": "MDQ6VXNlcjU4OTg1MzAx",
"avatar_url": "https://avatars.githubusercontent.com/u/58985301?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sgoudham",
"html_url": "https://github.com/sgoudham",
"followers_url": "https://api.github.com/users/sgoudham/followers",
"following_url": "https://api.github.com/users/sgoudham/following{/other_user}",
"gists_url": "https://api.github.com/users/sgoudham/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sgoudham/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sgoudham/subscriptions",
"organizations_url": "https://api.github.com/users/sgoudham/orgs",
"repos_url": "https://api.github.com/users/sgoudham/repos",
"events_url": "https://api.github.com/users/sgoudham/events{/privacy}",
"received_events_url": "https://api.github.com/users/sgoudham/received_events",
"type": "User",
"site_admin": false
},
"labels": [],
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 1,
"created_at": "2024-07-08T21:18:02Z",
"updated_at": "2024-09-14T18:15:15Z",
"closed_at": null,
"author_association": "COLLABORATOR",
"active_lock_reason": null,
"body": "We've received the following email on releases@catppuccin.com\r\n\r\n> Dear Maven Central publisher,\r\n>\r\n> We are making changes to the OSSRH authentication backend. For most users this should be a transparent process, and you should be able to continue to use your existing username and password to connect the Nexus UI. In case you need to update your password, please [follow our documentation](https://central.sonatype.org/register/central-portal/#managing-your-credentials).\r\n>\r\n> To configure a publisher's plugin authentication you would need to update your plugin settings to use [a user token](https://central.sonatype.org/publish/generate-token/) instead of the Nexus UI username and password login.\r\n>\r\n> For more information about publishing to legacy OSSRH please consult our documentation at [https://central.sonatype.org/register/legacy/](https://central.sonatype.org/register/legacy/)\r\n>\r\n> Thank you,\r\n> The Central Team\r\n\r\nI'm a little unsure if we are regarded as a \"publisher\" but we should look to see if we need to switch to a token based authentication workflow.",
"reactions": {
"url": "https://api.github.com/repos/catppuccin/java/issues/20/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
},
"timeline_url": "https://api.github.com/repos/catppuccin/java/issues/20/timeline",
"performed_via_github_app": null,
"state_reason": null
},
"comment": {
"url": "https://api.github.com/repos/catppuccin/java/issues/comments/2351090061",
"html_url": "https://github.com/catppuccin/java/issues/20#issuecomment-2351090061",
"issue_url": "https://api.github.com/repos/catppuccin/java/issues/20",
"id": 2351090061,
"node_id": "IC_kwDOIvYgYM6MIsmN",
"user": {
"login": "sgoudham",
"id": 58985301,
"node_id": "MDQ6VXNlcjU4OTg1MzAx",
"avatar_url": "https://avatars.githubusercontent.com/u/58985301?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sgoudham",
"html_url": "https://github.com/sgoudham",
"followers_url": "https://api.github.com/users/sgoudham/followers",
"following_url": "https://api.github.com/users/sgoudham/following{/other_user}",
"gists_url": "https://api.github.com/users/sgoudham/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sgoudham/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sgoudham/subscriptions",
"organizations_url": "https://api.github.com/users/sgoudham/orgs",
"repos_url": "https://api.github.com/users/sgoudham/repos",
"events_url": "https://api.github.com/users/sgoudham/events{/privacy}",
"received_events_url": "https://api.github.com/users/sgoudham/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2024-09-14T18:15:14Z",
"updated_at": "2024-09-14T18:15:14Z",
"author_association": "COLLABORATOR",
"body": "Testing",
"reactions": {
"url": "https://api.github.com/repos/catppuccin/java/issues/comments/2351090061/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
},
"performed_via_github_app": null
},
"repository": {
"id": 586555488,
"node_id": "R_kgDOIvYgYA",
"name": "java",
"full_name": "catppuccin/java",
"private": false,
"owner": {
"login": "catppuccin",
"id": 93489351,
"node_id": "O_kgDOBZKIxw",
"avatar_url": "https://avatars.githubusercontent.com/u/93489351?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/catppuccin",
"html_url": "https://github.com/catppuccin",
"followers_url": "https://api.github.com/users/catppuccin/followers",
"following_url": "https://api.github.com/users/catppuccin/following{/other_user}",
"gists_url": "https://api.github.com/users/catppuccin/gists{/gist_id}",
"starred_url": "https://api.github.com/users/catppuccin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/catppuccin/subscriptions",
"organizations_url": "https://api.github.com/users/catppuccin/orgs",
"repos_url": "https://api.github.com/users/catppuccin/repos",
"events_url": "https://api.github.com/users/catppuccin/events{/privacy}",
"received_events_url": "https://api.github.com/users/catppuccin/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/catppuccin/java",
"description": "☕ Soothing pastel theme for Java",
"fork": false,
"url": "https://api.github.com/repos/catppuccin/java",
"forks_url": "https://api.github.com/repos/catppuccin/java/forks",
"keys_url": "https://api.github.com/repos/catppuccin/java/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/catppuccin/java/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/catppuccin/java/teams",
"hooks_url": "https://api.github.com/repos/catppuccin/java/hooks",
"issue_events_url": "https://api.github.com/repos/catppuccin/java/issues/events{/number}",
"events_url": "https://api.github.com/repos/catppuccin/java/events",
"assignees_url": "https://api.github.com/repos/catppuccin/java/assignees{/user}",
"branches_url": "https://api.github.com/repos/catppuccin/java/branches{/branch}",
"tags_url": "https://api.github.com/repos/catppuccin/java/tags",
"blobs_url": "https://api.github.com/repos/catppuccin/java/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/catppuccin/java/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/catppuccin/java/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/catppuccin/java/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/catppuccin/java/statuses/{sha}",
"languages_url": "https://api.github.com/repos/catppuccin/java/languages",
"stargazers_url": "https://api.github.com/repos/catppuccin/java/stargazers",
"contributors_url": "https://api.github.com/repos/catppuccin/java/contributors",
"subscribers_url": "https://api.github.com/repos/catppuccin/java/subscribers",
"subscription_url": "https://api.github.com/repos/catppuccin/java/subscription",
"commits_url": "https://api.github.com/repos/catppuccin/java/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/catppuccin/java/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/catppuccin/java/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/catppuccin/java/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/catppuccin/java/contents/{+path}",
"compare_url": "https://api.github.com/repos/catppuccin/java/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/catppuccin/java/merges",
"archive_url": "https://api.github.com/repos/catppuccin/java/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/catppuccin/java/downloads",
"issues_url": "https://api.github.com/repos/catppuccin/java/issues{/number}",
"pulls_url": "https://api.github.com/repos/catppuccin/java/pulls{/number}",
"milestones_url": "https://api.github.com/repos/catppuccin/java/milestones{/number}",
"notifications_url": "https://api.github.com/repos/catppuccin/java/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/catppuccin/java/labels{/name}",
"releases_url": "https://api.github.com/repos/catppuccin/java/releases{/id}",
"deployments_url": "https://api.github.com/repos/catppuccin/java/deployments",
"created_at": "2023-01-08T15:00:35Z",
"updated_at": "2024-09-14T18:10:43Z",
"pushed_at": "2024-09-14T18:10:41Z",
"git_url": "git://github.com/catppuccin/java.git",
"ssh_url": "git@github.com:catppuccin/java.git",
"clone_url": "https://github.com/catppuccin/java.git",
"svn_url": "https://github.com/catppuccin/java",
"homepage": "https://search.maven.org/artifact/com.catppuccin/catppuccin-palette",
"size": 109,
"stargazers_count": 15,
"watchers_count": 15,
"language": "Java",
"has_issues": true,
"has_projects": false,
"has_downloads": true,
"has_wiki": false,
"has_pages": false,
"has_discussions": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 4,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [
"catppuccin",
"hacktoberfest",
"java",
"java-library",
"library"
],
"visibility": "public",
"forks": 0,
"open_issues": 4,
"watchers": 15,
"default_branch": "main",
"custom_properties": {
"whiskers": "not_applicable"
}
},
"organization": {
"login": "catppuccin",
"id": 93489351,
"node_id": "O_kgDOBZKIxw",
"url": "https://api.github.com/orgs/catppuccin",
"repos_url": "https://api.github.com/orgs/catppuccin/repos",
"events_url": "https://api.github.com/orgs/catppuccin/events",
"hooks_url": "https://api.github.com/orgs/catppuccin/hooks",
"issues_url": "https://api.github.com/orgs/catppuccin/issues",
"members_url": "https://api.github.com/orgs/catppuccin/members{/member}",
"public_members_url": "https://api.github.com/orgs/catppuccin/public_members{/member}",
"avatar_url": "https://avatars.githubusercontent.com/u/93489351?v=4",
"description": "Soothing pastel theme for the high-spirited!"
},
"sender": {
"login": "sgoudham",
"id": 58985301,
"node_id": "MDQ6VXNlcjU4OTg1MzAx",
"avatar_url": "https://avatars.githubusercontent.com/u/58985301?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sgoudham",
"html_url": "https://github.com/sgoudham",
"followers_url": "https://api.github.com/users/sgoudham/followers",
"following_url": "https://api.github.com/users/sgoudham/following{/other_user}",
"gists_url": "https://api.github.com/users/sgoudham/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sgoudham/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sgoudham/subscriptions",
"organizations_url": "https://api.github.com/users/sgoudham/orgs",
"repos_url": "https://api.github.com/users/sgoudham/repos",
"events_url": "https://api.github.com/users/sgoudham/events{/privacy}",
"received_events_url": "https://api.github.com/users/sgoudham/received_events",
"type": "User",
"site_admin": false
}
}
269 changes: 269 additions & 0 deletions fixtures/issue_comment/created_on_pull_request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
{
"action": "created",
"issue": {
"url": "https://api.github.com/repos/catppuccin/userstyles/issues/1323",
"repository_url": "https://api.github.com/repos/catppuccin/userstyles",
"labels_url": "https://api.github.com/repos/catppuccin/userstyles/issues/1323/labels{/name}",
"comments_url": "https://api.github.com/repos/catppuccin/userstyles/issues/1323/comments",
"events_url": "https://api.github.com/repos/catppuccin/userstyles/issues/1323/events",
"html_url": "https://github.com/catppuccin/userstyles/pull/1323",
"id": 2532343494,
"node_id": "PR_kwDOJCgd3c5706xI",
"number": 1323,
"title": "feat(fontawesome): init",
"user": {
"login": "trinkey",
"id": 97406176,
"node_id": "U_kgDOBc5M4A",
"avatar_url": "https://avatars.githubusercontent.com/u/97406176?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/trinkey",
"html_url": "https://github.com/trinkey",
"followers_url": "https://api.github.com/users/trinkey/followers",
"following_url": "https://api.github.com/users/trinkey/following{/other_user}",
"gists_url": "https://api.github.com/users/trinkey/gists{/gist_id}",
"starred_url": "https://api.github.com/users/trinkey/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/trinkey/subscriptions",
"organizations_url": "https://api.github.com/users/trinkey/orgs",
"repos_url": "https://api.github.com/users/trinkey/repos",
"events_url": "https://api.github.com/users/trinkey/events{/privacy}",
"received_events_url": "https://api.github.com/users/trinkey/received_events",
"type": "User",
"site_admin": false
},
"labels": [],
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 1,
"created_at": "2024-09-17T23:08:47Z",
"updated_at": "2024-09-17T23:44:54Z",
"closed_at": null,
"author_association": "CONTRIBUTOR",
"active_lock_reason": null,
"draft": false,
"pull_request": {
"url": "https://api.github.com/repos/catppuccin/userstyles/pulls/1323",
"html_url": "https://github.com/catppuccin/userstyles/pull/1323",
"diff_url": "https://github.com/catppuccin/userstyles/pull/1323.diff",
"patch_url": "https://github.com/catppuccin/userstyles/pull/1323.patch",
"merged_at": null
},
"body": "## 🎉 Theme for Font Awesome 🎉\r\nAn svg icon library that kinda sucks but not as much as their website's css\r\n\r\n## 💬 Additional Comments 💬\r\n- this websites uses variables. occasionally.\r\n- sometimes inline styles redefine variables\r\n- why are there so many inline styles\r\n- the inline styles don't stop help\r\n\r\n## 🗒 Checklist 🗒\r\n\r\n- [x] I have read and followed Catppuccin's [submission guidelines](https://github.com/catppuccin/userstyles/blob/main/docs/userstyle-creation.md).\r\n- [x] I have made a new directory underneath `/styles/<name-of-website>` containing the contents of the [`/template`](https://github.com/catppuccin/userstyles/blob/main/template/) directory.\r\n - [x] I have ensured that the new directory is in **lower-kebab-case**.\r\n - [x] I have followed the template and kept the preprocessor as [LESS](https://lesscss.org/#overview).\r\n- [x] I have made sure to update the\r\n [`userstyles.yml`](https://github.com/catppuccin/userstyles/blob/main/scripts/userstyles.yml)\r\n file with information about the new userstyle.\r\n- [x] I have included the following files:\r\n - [x] `catppuccin.user.css` - all the CSS for the userstyle, based on the\r\n template.\r\n - [x] `preview.webp` - composite image of all four individual flavor screenshots (taken with the default accent color of mauve) stitched together, generated via [Catwalk](https://github.com/catppuccin/catwalk).\r\n",
"reactions": {
"url": "https://api.github.com/repos/catppuccin/userstyles/issues/1323/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
},
"timeline_url": "https://api.github.com/repos/catppuccin/userstyles/issues/1323/timeline",
"performed_via_github_app": null,
"state_reason": null
},
"comment": {
"url": "https://api.github.com/repos/catppuccin/userstyles/issues/comments/2357211297",
"html_url": "https://github.com/catppuccin/userstyles/pull/1323#issuecomment-2357211297",
"issue_url": "https://api.github.com/repos/catppuccin/userstyles/issues/1323",
"id": 2357211297,
"node_id": "IC_kwDOJCgd3c6MgDCh",
"user": {
"login": "trinkey",
"id": 97406176,
"node_id": "U_kgDOBc5M4A",
"avatar_url": "https://avatars.githubusercontent.com/u/97406176?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/trinkey",
"html_url": "https://github.com/trinkey",
"followers_url": "https://api.github.com/users/trinkey/followers",
"following_url": "https://api.github.com/users/trinkey/following{/other_user}",
"gists_url": "https://api.github.com/users/trinkey/gists{/gist_id}",
"starred_url": "https://api.github.com/users/trinkey/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/trinkey/subscriptions",
"organizations_url": "https://api.github.com/users/trinkey/orgs",
"repos_url": "https://api.github.com/users/trinkey/repos",
"events_url": "https://api.github.com/users/trinkey/events{/privacy}",
"received_events_url": "https://api.github.com/users/trinkey/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2024-09-17T23:44:53Z",
"updated_at": "2024-09-17T23:44:53Z",
"author_association": "CONTRIBUTOR",
"body": "404 page isn't styled ughhhhhhhhhhhhhh",
"reactions": {
"url": "https://api.github.com/repos/catppuccin/userstyles/issues/comments/2357211297/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
},
"performed_via_github_app": null
},
"repository": {
"id": 606608861,
"node_id": "R_kgDOJCgd3Q",
"name": "userstyles",
"full_name": "catppuccin/userstyles",
"private": false,
"owner": {
"login": "catppuccin",
"id": 93489351,
"node_id": "O_kgDOBZKIxw",
"avatar_url": "https://avatars.githubusercontent.com/u/93489351?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/catppuccin",
"html_url": "https://github.com/catppuccin",
"followers_url": "https://api.github.com/users/catppuccin/followers",
"following_url": "https://api.github.com/users/catppuccin/following{/other_user}",
"gists_url": "https://api.github.com/users/catppuccin/gists{/gist_id}",
"starred_url": "https://api.github.com/users/catppuccin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/catppuccin/subscriptions",
"organizations_url": "https://api.github.com/users/catppuccin/orgs",
"repos_url": "https://api.github.com/users/catppuccin/repos",
"events_url": "https://api.github.com/users/catppuccin/events{/privacy}",
"received_events_url": "https://api.github.com/users/catppuccin/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/catppuccin/userstyles",
"description": "🖌 Soothing pastel userstyles",
"fork": false,
"url": "https://api.github.com/repos/catppuccin/userstyles",
"forks_url": "https://api.github.com/repos/catppuccin/userstyles/forks",
"keys_url": "https://api.github.com/repos/catppuccin/userstyles/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/catppuccin/userstyles/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/catppuccin/userstyles/teams",
"hooks_url": "https://api.github.com/repos/catppuccin/userstyles/hooks",
"issue_events_url": "https://api.github.com/repos/catppuccin/userstyles/issues/events{/number}",
"events_url": "https://api.github.com/repos/catppuccin/userstyles/events",
"assignees_url": "https://api.github.com/repos/catppuccin/userstyles/assignees{/user}",
"branches_url": "https://api.github.com/repos/catppuccin/userstyles/branches{/branch}",
"tags_url": "https://api.github.com/repos/catppuccin/userstyles/tags",
"blobs_url": "https://api.github.com/repos/catppuccin/userstyles/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/catppuccin/userstyles/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/catppuccin/userstyles/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/catppuccin/userstyles/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/catppuccin/userstyles/statuses/{sha}",
"languages_url": "https://api.github.com/repos/catppuccin/userstyles/languages",
"stargazers_url": "https://api.github.com/repos/catppuccin/userstyles/stargazers",
"contributors_url": "https://api.github.com/repos/catppuccin/userstyles/contributors",
"subscribers_url": "https://api.github.com/repos/catppuccin/userstyles/subscribers",
"subscription_url": "https://api.github.com/repos/catppuccin/userstyles/subscription",
"commits_url": "https://api.github.com/repos/catppuccin/userstyles/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/catppuccin/userstyles/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/catppuccin/userstyles/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/catppuccin/userstyles/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/catppuccin/userstyles/contents/{+path}",
"compare_url": "https://api.github.com/repos/catppuccin/userstyles/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/catppuccin/userstyles/merges",
"archive_url": "https://api.github.com/repos/catppuccin/userstyles/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/catppuccin/userstyles/downloads",
"issues_url": "https://api.github.com/repos/catppuccin/userstyles/issues{/number}",
"pulls_url": "https://api.github.com/repos/catppuccin/userstyles/pulls{/number}",
"milestones_url": "https://api.github.com/repos/catppuccin/userstyles/milestones{/number}",
"notifications_url": "https://api.github.com/repos/catppuccin/userstyles/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/catppuccin/userstyles/labels{/name}",
"releases_url": "https://api.github.com/repos/catppuccin/userstyles/releases{/id}",
"deployments_url": "https://api.github.com/repos/catppuccin/userstyles/deployments",
"created_at": "2023-02-26T01:55:38Z",
"updated_at": "2024-09-17T18:55:57Z",
"pushed_at": "2024-09-17T18:55:53Z",
"git_url": "git://github.com/catppuccin/userstyles.git",
"ssh_url": "git@github.com:catppuccin/userstyles.git",
"clone_url": "https://github.com/catppuccin/userstyles.git",
"svn_url": "https://github.com/catppuccin/userstyles",
"homepage": "",
"size": 22694,
"stargazers_count": 450,
"watchers_count": 450,
"language": "Less",
"has_issues": true,
"has_projects": false,
"has_downloads": true,
"has_wiki": false,
"has_pages": false,
"has_discussions": false,
"forks_count": 134,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 65,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [
"catppuccin",
"hacktoberfest",
"less",
"meta",
"palette",
"soothing",
"stylus",
"theme",
"userstyles",
"website"
],
"visibility": "public",
"forks": 134,
"open_issues": 65,
"watchers": 450,
"default_branch": "main",
"custom_properties": {
"whiskers": "not_applicable"
}
},
"organization": {
"login": "catppuccin",
"id": 93489351,
"node_id": "O_kgDOBZKIxw",
"url": "https://api.github.com/orgs/catppuccin",
"repos_url": "https://api.github.com/orgs/catppuccin/repos",
"events_url": "https://api.github.com/orgs/catppuccin/events",
"hooks_url": "https://api.github.com/orgs/catppuccin/hooks",
"issues_url": "https://api.github.com/orgs/catppuccin/issues",
"members_url": "https://api.github.com/orgs/catppuccin/members{/member}",
"public_members_url": "https://api.github.com/orgs/catppuccin/public_members{/member}",
"avatar_url": "https://avatars.githubusercontent.com/u/93489351?v=4",
"description": "Soothing pastel theme for the high-spirited!"
},
"sender": {
"login": "trinkey",
"id": 97406176,
"node_id": "U_kgDOBc5M4A",
"avatar_url": "https://avatars.githubusercontent.com/u/97406176?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/trinkey",
"html_url": "https://github.com/trinkey",
"followers_url": "https://api.github.com/users/trinkey/followers",
"following_url": "https://api.github.com/users/trinkey/following{/other_user}",
"gists_url": "https://api.github.com/users/trinkey/gists{/gist_id}",
"starred_url": "https://api.github.com/users/trinkey/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/trinkey/subscriptions",
"organizations_url": "https://api.github.com/users/trinkey/orgs",
"repos_url": "https://api.github.com/users/trinkey/repos",
"events_url": "https://api.github.com/users/trinkey/events{/privacy}",
"received_events_url": "https://api.github.com/users/trinkey/received_events",
"type": "User",
"site_admin": false
}
}
256 changes: 256 additions & 0 deletions fixtures/issue_comment/deleted.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
{
"action": "deleted",
"issue": {
"url": "https://api.github.com/repos/catppuccin/java/issues/20",
"repository_url": "https://api.github.com/repos/catppuccin/java",
"labels_url": "https://api.github.com/repos/catppuccin/java/issues/20/labels{/name}",
"comments_url": "https://api.github.com/repos/catppuccin/java/issues/20/comments",
"events_url": "https://api.github.com/repos/catppuccin/java/issues/20/events",
"html_url": "https://github.com/catppuccin/java/issues/20",
"id": 2396591382,
"node_id": "I_kwDOIvYgYM6O2RUW",
"number": 20,
"title": "Reconsider OSSRH Authentication",
"user": {
"login": "sgoudham",
"id": 58985301,
"node_id": "MDQ6VXNlcjU4OTg1MzAx",
"avatar_url": "https://avatars.githubusercontent.com/u/58985301?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sgoudham",
"html_url": "https://github.com/sgoudham",
"followers_url": "https://api.github.com/users/sgoudham/followers",
"following_url": "https://api.github.com/users/sgoudham/following{/other_user}",
"gists_url": "https://api.github.com/users/sgoudham/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sgoudham/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sgoudham/subscriptions",
"organizations_url": "https://api.github.com/users/sgoudham/orgs",
"repos_url": "https://api.github.com/users/sgoudham/repos",
"events_url": "https://api.github.com/users/sgoudham/events{/privacy}",
"received_events_url": "https://api.github.com/users/sgoudham/received_events",
"type": "User",
"site_admin": false
},
"labels": [],
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 1,
"created_at": "2024-07-08T21:18:02Z",
"updated_at": "2024-09-14T18:15:15Z",
"closed_at": null,
"author_association": "COLLABORATOR",
"active_lock_reason": null,
"body": "We've received the following email on releases@catppuccin.com\r\n\r\n> Dear Maven Central publisher,\r\n>\r\n> We are making changes to the OSSRH authentication backend. For most users this should be a transparent process, and you should be able to continue to use your existing username and password to connect the Nexus UI. In case you need to update your password, please [follow our documentation](https://central.sonatype.org/register/central-portal/#managing-your-credentials).\r\n>\r\n> To configure a publisher's plugin authentication you would need to update your plugin settings to use [a user token](https://central.sonatype.org/publish/generate-token/) instead of the Nexus UI username and password login.\r\n>\r\n> For more information about publishing to legacy OSSRH please consult our documentation at [https://central.sonatype.org/register/legacy/](https://central.sonatype.org/register/legacy/)\r\n>\r\n> Thank you,\r\n> The Central Team\r\n\r\nI'm a little unsure if we are regarded as a \"publisher\" but we should look to see if we need to switch to a token based authentication workflow.",
"reactions": {
"url": "https://api.github.com/repos/catppuccin/java/issues/20/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
},
"timeline_url": "https://api.github.com/repos/catppuccin/java/issues/20/timeline",
"performed_via_github_app": null,
"state_reason": null
},
"comment": {
"url": "https://api.github.com/repos/catppuccin/java/issues/comments/2351090061",
"html_url": "https://github.com/catppuccin/java/issues/20#issuecomment-2351090061",
"issue_url": "https://api.github.com/repos/catppuccin/java/issues/20",
"id": 2351090061,
"node_id": "IC_kwDOIvYgYM6MIsmN",
"user": {
"login": "sgoudham",
"id": 58985301,
"node_id": "MDQ6VXNlcjU4OTg1MzAx",
"avatar_url": "https://avatars.githubusercontent.com/u/58985301?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sgoudham",
"html_url": "https://github.com/sgoudham",
"followers_url": "https://api.github.com/users/sgoudham/followers",
"following_url": "https://api.github.com/users/sgoudham/following{/other_user}",
"gists_url": "https://api.github.com/users/sgoudham/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sgoudham/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sgoudham/subscriptions",
"organizations_url": "https://api.github.com/users/sgoudham/orgs",
"repos_url": "https://api.github.com/users/sgoudham/repos",
"events_url": "https://api.github.com/users/sgoudham/events{/privacy}",
"received_events_url": "https://api.github.com/users/sgoudham/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2024-09-14T18:15:14Z",
"updated_at": "2024-09-14T18:15:14Z",
"author_association": "COLLABORATOR",
"body": "Testing",
"reactions": {
"url": "https://api.github.com/repos/catppuccin/java/issues/comments/2351090061/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
},
"performed_via_github_app": null
},
"repository": {
"id": 586555488,
"node_id": "R_kgDOIvYgYA",
"name": "java",
"full_name": "catppuccin/java",
"private": false,
"owner": {
"login": "catppuccin",
"id": 93489351,
"node_id": "O_kgDOBZKIxw",
"avatar_url": "https://avatars.githubusercontent.com/u/93489351?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/catppuccin",
"html_url": "https://github.com/catppuccin",
"followers_url": "https://api.github.com/users/catppuccin/followers",
"following_url": "https://api.github.com/users/catppuccin/following{/other_user}",
"gists_url": "https://api.github.com/users/catppuccin/gists{/gist_id}",
"starred_url": "https://api.github.com/users/catppuccin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/catppuccin/subscriptions",
"organizations_url": "https://api.github.com/users/catppuccin/orgs",
"repos_url": "https://api.github.com/users/catppuccin/repos",
"events_url": "https://api.github.com/users/catppuccin/events{/privacy}",
"received_events_url": "https://api.github.com/users/catppuccin/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/catppuccin/java",
"description": "☕ Soothing pastel theme for Java",
"fork": false,
"url": "https://api.github.com/repos/catppuccin/java",
"forks_url": "https://api.github.com/repos/catppuccin/java/forks",
"keys_url": "https://api.github.com/repos/catppuccin/java/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/catppuccin/java/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/catppuccin/java/teams",
"hooks_url": "https://api.github.com/repos/catppuccin/java/hooks",
"issue_events_url": "https://api.github.com/repos/catppuccin/java/issues/events{/number}",
"events_url": "https://api.github.com/repos/catppuccin/java/events",
"assignees_url": "https://api.github.com/repos/catppuccin/java/assignees{/user}",
"branches_url": "https://api.github.com/repos/catppuccin/java/branches{/branch}",
"tags_url": "https://api.github.com/repos/catppuccin/java/tags",
"blobs_url": "https://api.github.com/repos/catppuccin/java/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/catppuccin/java/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/catppuccin/java/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/catppuccin/java/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/catppuccin/java/statuses/{sha}",
"languages_url": "https://api.github.com/repos/catppuccin/java/languages",
"stargazers_url": "https://api.github.com/repos/catppuccin/java/stargazers",
"contributors_url": "https://api.github.com/repos/catppuccin/java/contributors",
"subscribers_url": "https://api.github.com/repos/catppuccin/java/subscribers",
"subscription_url": "https://api.github.com/repos/catppuccin/java/subscription",
"commits_url": "https://api.github.com/repos/catppuccin/java/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/catppuccin/java/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/catppuccin/java/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/catppuccin/java/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/catppuccin/java/contents/{+path}",
"compare_url": "https://api.github.com/repos/catppuccin/java/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/catppuccin/java/merges",
"archive_url": "https://api.github.com/repos/catppuccin/java/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/catppuccin/java/downloads",
"issues_url": "https://api.github.com/repos/catppuccin/java/issues{/number}",
"pulls_url": "https://api.github.com/repos/catppuccin/java/pulls{/number}",
"milestones_url": "https://api.github.com/repos/catppuccin/java/milestones{/number}",
"notifications_url": "https://api.github.com/repos/catppuccin/java/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/catppuccin/java/labels{/name}",
"releases_url": "https://api.github.com/repos/catppuccin/java/releases{/id}",
"deployments_url": "https://api.github.com/repos/catppuccin/java/deployments",
"created_at": "2023-01-08T15:00:35Z",
"updated_at": "2024-09-14T18:10:43Z",
"pushed_at": "2024-09-14T18:10:41Z",
"git_url": "git://github.com/catppuccin/java.git",
"ssh_url": "git@github.com:catppuccin/java.git",
"clone_url": "https://github.com/catppuccin/java.git",
"svn_url": "https://github.com/catppuccin/java",
"homepage": "https://search.maven.org/artifact/com.catppuccin/catppuccin-palette",
"size": 109,
"stargazers_count": 15,
"watchers_count": 15,
"language": "Java",
"has_issues": true,
"has_projects": false,
"has_downloads": true,
"has_wiki": false,
"has_pages": false,
"has_discussions": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 4,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [
"catppuccin",
"hacktoberfest",
"java",
"java-library",
"library"
],
"visibility": "public",
"forks": 0,
"open_issues": 4,
"watchers": 15,
"default_branch": "main",
"custom_properties": {
"whiskers": "not_applicable"
}
},
"organization": {
"login": "catppuccin",
"id": 93489351,
"node_id": "O_kgDOBZKIxw",
"url": "https://api.github.com/orgs/catppuccin",
"repos_url": "https://api.github.com/orgs/catppuccin/repos",
"events_url": "https://api.github.com/orgs/catppuccin/events",
"hooks_url": "https://api.github.com/orgs/catppuccin/hooks",
"issues_url": "https://api.github.com/orgs/catppuccin/issues",
"members_url": "https://api.github.com/orgs/catppuccin/members{/member}",
"public_members_url": "https://api.github.com/orgs/catppuccin/public_members{/member}",
"avatar_url": "https://avatars.githubusercontent.com/u/93489351?v=4",
"description": "Soothing pastel theme for the high-spirited!"
},
"sender": {
"login": "sgoudham",
"id": 58985301,
"node_id": "MDQ6VXNlcjU4OTg1MzAx",
"avatar_url": "https://avatars.githubusercontent.com/u/58985301?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sgoudham",
"html_url": "https://github.com/sgoudham",
"followers_url": "https://api.github.com/users/sgoudham/followers",
"following_url": "https://api.github.com/users/sgoudham/following{/other_user}",
"gists_url": "https://api.github.com/users/sgoudham/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sgoudham/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sgoudham/subscriptions",
"organizations_url": "https://api.github.com/users/sgoudham/orgs",
"repos_url": "https://api.github.com/users/sgoudham/repos",
"events_url": "https://api.github.com/users/sgoudham/events{/privacy}",
"received_events_url": "https://api.github.com/users/sgoudham/received_events",
"type": "User",
"site_admin": false
}
}
72 changes: 51 additions & 21 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -129,8 +129,16 @@ struct Issue {
number: u64,
html_url: String,
body: Option<String>,
pull_request: Option<IssueCommentPullRequest>,
}

/// "This event occurs when there is activity relating to a comment on an issue
/// or pull request."
///
/// <https://docs.github.com/en/webhooks/webhook-events-and-payloads#issue_comment>
#[derive(serde::Deserialize)]
struct IssueCommentPullRequest {}

#[derive(serde::Deserialize)]
struct PullRequest {
title: String,
@@ -294,10 +302,17 @@ fn make_discord_message(e: &Event) -> anyhow::Result<Option<serde_json::Value>>
if e.action != "created" {
return Ok(None);
}

if let Some(issue) = &e.issue {
let action = if issue.pull_request.is_some() {
"pull request"
} else {
"issue"
};

embed.title(&format!(
"[{}] New comment on issue #{}: {}",
e.repository.full_name, issue.number, issue.title
"[{}] New comment on {} #{}: {}",
e.repository.full_name, action, issue.number, issue.title
));
#[allow(clippy::unreadable_literal)]
embed.color(0xe68d60);
@@ -449,25 +464,6 @@ fn hook_target(e: &Event) -> HookTarget {
mod tests {
use crate::{make_discord_message, Event};

#[test]
fn test_comment_created() {
let payload = include_str!("../fixtures/comment_created.json");
let e: Event = serde_json::from_str(payload).unwrap();
let msg = make_discord_message(&e).unwrap().unwrap();
assert_eq!(
msg["embeds"][0]["title"].as_str().unwrap(),
"[catppuccin/java] New comment on issue #20: Reconsider OSSRH Authentication"
);
}

#[test]
fn test_comment_deleted() {
let payload = include_str!("../fixtures/comment_deleted.json");
let e: Event = serde_json::from_str(payload).unwrap();
let msg = make_discord_message(&e).unwrap();
assert!(msg.is_none());
}

#[test]
fn test_bot_pull_request_opened() {
let payload = include_str!("../fixtures/bot_pull_request_opened.json");
@@ -523,6 +519,40 @@ mod tests {
assert!(msg.is_none());
}

mod issue_comment {
use crate::{make_discord_message, Event};

#[test]
fn created() {
let payload = include_str!("../fixtures/issue_comment/created.json");
let e: Event = serde_json::from_str(payload).unwrap();
let msg = make_discord_message(&e).unwrap().unwrap();
assert_eq!(
msg["embeds"][0]["title"].as_str().unwrap(),
"[catppuccin/java] New comment on issue #20: Reconsider OSSRH Authentication"
);
}

#[test]
fn created_on_pull_request() {
let payload = include_str!("../fixtures/issue_comment/created_on_pull_request.json");
let e: Event = serde_json::from_str(payload).unwrap();
let msg = make_discord_message(&e).unwrap().unwrap();
assert_eq!(
msg["embeds"][0]["title"].as_str().unwrap(),
"[catppuccin/userstyles] New comment on pull request #1323: feat(fontawesome): init"
);
}

#[test]
fn deleted() {
let payload = include_str!("../fixtures/issue_comment/deleted.json");
let e: Event = serde_json::from_str(payload).unwrap();
let msg = make_discord_message(&e).unwrap();
assert!(msg.is_none());
}
}

mod pull_request_review {
use crate::{make_discord_message, Event};