From fad4e45373fbbcf84bae10f9e63be009c7b5ab73 Mon Sep 17 00:00:00 2001 From: Josh Gross Date: Wed, 18 Jan 2023 16:01:13 -0500 Subject: [PATCH 1/2] Add merge group event payload --- .../context-providers/events/eventPayloads.ts | 2 + .../context-providers/events/merge_group.json | 154 ++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 actions-languageservice/src/context-providers/events/merge_group.json diff --git a/actions-languageservice/src/context-providers/events/eventPayloads.ts b/actions-languageservice/src/context-providers/events/eventPayloads.ts index abf08bf..dcfeb69 100644 --- a/actions-languageservice/src/context-providers/events/eventPayloads.ts +++ b/actions-languageservice/src/context-providers/events/eventPayloads.ts @@ -18,6 +18,7 @@ import label from "./label.json"; import marketplace_purchase from "./marketplace_purchase.json"; import member from "./member.json"; import membership from "./membership.json"; +import merge_group from "./merge_group.json"; import meta from "./meta.json"; import milestone from "./milestone.json"; import org_block from "./org_block.json"; @@ -70,6 +71,7 @@ export const eventPayloads: {[key: string]: Object} = { marketplace_purchase, member, membership, + merge_group, meta, milestone, org_block, diff --git a/actions-languageservice/src/context-providers/events/merge_group.json b/actions-languageservice/src/context-providers/events/merge_group.json new file mode 100644 index 0000000..38f53b5 --- /dev/null +++ b/actions-languageservice/src/context-providers/events/merge_group.json @@ -0,0 +1,154 @@ +{ + "action": "checks_requested", + "installation": { + "id": 375706, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMzc1NzA2" + }, + "merge_group": { + "head_sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "head_ref": "main", + "base_sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", + "base_ref": "features/branch", + "head_commit": { + "id": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", + "tree_id": "31b122c26a97cf9af023e9ddab94a82c6e77b0ea", + "message": "Update README.md", + "timestamp": "2019-05-15T15:20:30Z", + "author": { + "name": "Codertocat", + "email": "21031067+Codertocat@users.noreply.github.com" + }, + "committer": { + "name": "Codertocat", + "email": "21031067+Codertocat@users.noreply.github.com" + } + } + }, + "repository": { + "id": 17273051, + "node_id": "MDEwOlJlcG9zaXRvcnkxNzI3MzA1MQ==", + "name": "octo-repo", + "full_name": "octo-org/octo-repo", + "private": true, + "owner": { + "login": "octo-org", + "id": 6811672, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=", + "avatar_url": "https://avatars3.githubusercontent.com/u/6811672?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/octo-org", + "html_url": "https://github.com/octo-org", + "followers_url": "https://api.github.com/users/octo-org/followers", + "following_url": "https://api.github.com/users/octo-org/following{/other_user}", + "gists_url": "https://api.github.com/users/octo-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octo-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octo-org/subscriptions", + "organizations_url": "https://api.github.com/users/octo-org/orgs", + "repos_url": "https://api.github.com/users/octo-org/repos", + "events_url": "https://api.github.com/users/octo-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/octo-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/octo-org/octo-repo", + "description": "My first repo on GitHub!", + "fork": false, + "url": "https://api.github.com/repos/octo-org/octo-repo", + "forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks", + "keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams", + "hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks", + "issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}", + "events_url": "https://api.github.com/repos/octo-org/octo-repo/events", + "assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}", + "branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}", + "tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags", + "blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages", + "stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers", + "contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors", + "subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers", + "subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription", + "commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}", + "compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges", + "archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads", + "issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}", + "pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}", + "releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}", + "deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments", + "created_at": "2014-02-28T02:42:51Z", + "updated_at": "2018-10-10T15:58:51Z", + "pushed_at": "2018-10-10T15:58:47Z", + "git_url": "git://github.com/octo-org/octo-repo.git", + "ssh_url": "git@github.com:octo-org/octo-repo.git", + "clone_url": "https://github.com/octo-org/octo-repo.git", + "svn_url": "https://github.com/octo-org/octo-repo", + "homepage": "", + "size": 59, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "open_issues_count": 23, + "license": null, + "forks": 1, + "open_issues": 23, + "watchers": 0, + "default_branch": "main" + }, + "organization": { + "login": "octo-org", + "id": 6811672, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=", + "url": "https://api.github.com/orgs/octo-org", + "repos_url": "https://api.github.com/orgs/octo-org/repos", + "events_url": "https://api.github.com/orgs/octo-org/events", + "hooks_url": "https://api.github.com/orgs/octo-org/hooks", + "issues_url": "https://api.github.com/orgs/octo-org/issues", + "members_url": "https://api.github.com/orgs/octo-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/octo-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/6811672?v=4", + "description": "Working better together!" + }, + "sender": { + "login": "Codertocat", + "id": 21031067, + "node_id": "MDQ6VXNlcjIxMDMxMDY3", + "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Codertocat", + "html_url": "https://github.com/Codertocat", + "followers_url": "https://api.github.com/users/Codertocat/followers", + "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", + "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", + "organizations_url": "https://api.github.com/users/Codertocat/orgs", + "repos_url": "https://api.github.com/users/Codertocat/repos", + "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/Codertocat/received_events", + "type": "User", + "site_admin": false + } +} \ No newline at end of file From 39688a11351b0bbb3b0f543bccbcd7f68ef16832 Mon Sep 17 00:00:00 2001 From: Josh Gross Date: Wed, 18 Jan 2023 16:14:30 -0500 Subject: [PATCH 2/2] Use example from docs --- .../context-providers/events/merge_group.json | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/actions-languageservice/src/context-providers/events/merge_group.json b/actions-languageservice/src/context-providers/events/merge_group.json index 38f53b5..2669cb8 100644 --- a/actions-languageservice/src/context-providers/events/merge_group.json +++ b/actions-languageservice/src/context-providers/events/merge_group.json @@ -1,18 +1,14 @@ { "action": "checks_requested", - "installation": { - "id": 375706, - "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMzc1NzA2" - }, "merge_group": { - "head_sha": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", - "head_ref": "main", - "base_sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", - "base_ref": "features/branch", + "head_sha": "2ffea6db159f6b6c47a24e778fb9ef40cf6b1c7d", + "head_ref": "refs/heads/gh-readonly-queue/main/pr-104-929f8209d40f77f4abc622a499c93a83babdbe64", + "base_sha": "380387fbc80638b734a49e1be1c4dfec1c01b33c", + "base_ref": "refs/heads/main", "head_commit": { "id": "ec26c3e57ca3a959ca5aad62de7213c562f8c821", "tree_id": "31b122c26a97cf9af023e9ddab94a82c6e77b0ea", - "message": "Update README.md", + "message": "Merge pull request #2048 from octo-repo/update-readme\n\nUpdate README.md", "timestamp": "2019-05-15T15:20:30Z", "author": { "name": "Codertocat", @@ -34,7 +30,7 @@ "login": "octo-org", "id": 6811672, "node_id": "MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=", - "avatar_url": "https://avatars3.githubusercontent.com/u/6811672?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/6811672?v=4", "gravatar_id": "", "url": "https://api.github.com/users/octo-org", "html_url": "https://github.com/octo-org", @@ -91,29 +87,30 @@ "releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}", "deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments", "created_at": "2014-02-28T02:42:51Z", - "updated_at": "2018-10-10T15:58:51Z", - "pushed_at": "2018-10-10T15:58:47Z", + "updated_at": "2021-03-11T14:54:13Z", + "pushed_at": "2021-03-11T14:54:10Z", "git_url": "git://github.com/octo-org/octo-repo.git", - "ssh_url": "git@github.com:octo-org/octo-repo.git", + "ssh_url": "org-6811672@github.com:octo-org/octo-repo.git", "clone_url": "https://github.com/octo-org/octo-repo.git", "svn_url": "https://github.com/octo-org/octo-repo", "homepage": "", - "size": 59, + "size": 300, "stargazers_count": 0, "watchers_count": 0, "language": "JavaScript", "has_issues": true, - "has_projects": true, + "has_projects": false, "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 1, + "has_wiki": false, + "has_pages": true, + "forks_count": 0, "mirror_url": null, "archived": false, - "open_issues_count": 23, + "disabled": false, + "open_issues_count": 39, "license": null, - "forks": 1, - "open_issues": 23, + "forks": 0, + "open_issues": 39, "watchers": 0, "default_branch": "main" }, @@ -128,7 +125,7 @@ "issues_url": "https://api.github.com/orgs/octo-org/issues", "members_url": "https://api.github.com/orgs/octo-org/members{/member}", "public_members_url": "https://api.github.com/orgs/octo-org/public_members{/member}", - "avatar_url": "https://avatars3.githubusercontent.com/u/6811672?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/6811672?v=4", "description": "Working better together!" }, "sender": { @@ -150,5 +147,9 @@ "received_events_url": "https://api.github.com/users/Codertocat/received_events", "type": "User", "site_admin": false + }, + "installation": { + "id": 1, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjY4MTE2NzI=" } } \ No newline at end of file