alexellis/derek

Derek to populate release notes from matching PRs/Issues with milestone

alexellis opened this issue · 4 comments

So now that we have milestone support it would be good to have Derek help compile the description for releases by reacting to the event fired and then doing a quick search and populating the text i.e.

Changelog:

- PR x by username

This would be an optional feature.

Can we do this with the GitHub API or even enable ‘Derek release’ on an issue to have him trigger a release through the GH API?

Sample event from openfaas/org-tester

{
  "action": "published",
  "release": {
    "url": "https://api.github.com/repos/openfaas/org-tester/releases/21146492",
    "assets_url": "https://api.github.com/repos/openfaas/org-tester/releases/21146492/assets",
    "upload_url": "https://uploads.github.com/repos/openfaas/org-tester/releases/21146492/assets{?name,label}",
    "html_url": "https://github.com/openfaas/org-tester/releases/tag/0.1.0",
    "id": 21146492,
    "node_id": "MDc6UmVsZWFzZTIxMTQ2NDky",
    "tag_name": "0.1.0",
    "target_commitish": "master",
    "name": "Initial",
    "draft": false,
    "author": {
      "login": "alexellis",
      "id": 6358735,
      "node_id": "MDQ6VXNlcjYzNTg3MzU=",
      "avatar_url": "https://avatars1.githubusercontent.com/u/6358735?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/alexellis",
      "html_url": "https://github.com/alexellis",
      "followers_url": "https://api.github.com/users/alexellis/followers",
      "following_url": "https://api.github.com/users/alexellis/following{/other_user}",
      "gists_url": "https://api.github.com/users/alexellis/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/alexellis/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/alexellis/subscriptions",
      "organizations_url": "https://api.github.com/users/alexellis/orgs",
      "repos_url": "https://api.github.com/users/alexellis/repos",
      "events_url": "https://api.github.com/users/alexellis/events{/privacy}",
      "received_events_url": "https://api.github.com/users/alexellis/received_events",
      "type": "User",
      "site_admin": false
    },
    "prerelease": false,
    "created_at": "2018-05-17T11:30:11Z",
    "published_at": "2019-11-01T12:12:46Z",
    "assets": [

    ],
    "tarball_url": "https://api.github.com/repos/openfaas/org-tester/tarball/0.1.0",
    "zipball_url": "https://api.github.com/repos/openfaas/org-tester/zipball/0.1.0",
    "body": "Hi 👋 "
  },
  "repository": {
    "id": 104450599,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMDQ0NTA1OTk=",
    "name": "org-tester",
    "full_name": "openfaas/org-tester",
    "private": false,
    "owner": {
      "login": "openfaas",
      "id": 27013154,
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjI3MDEzMTU0",
      "avatar_url": "https://avatars3.githubusercontent.com/u/27013154?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/openfaas",
      "html_url": "https://github.com/openfaas",
      "followers_url": "https://api.github.com/users/openfaas/followers",
      "following_url": "https://api.github.com/users/openfaas/following{/other_user}",
      "gists_url": "https://api.github.com/users/openfaas/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/openfaas/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/openfaas/subscriptions",
      "organizations_url": "https://api.github.com/users/openfaas/orgs",
      "repos_url": "https://api.github.com/users/openfaas/repos",
      "events_url": "https://api.github.com/users/openfaas/events{/privacy}",
      "received_events_url": "https://api.github.com/users/openfaas/received_events",
      "type": "Organization",
      "site_admin": false
    },
    "html_url": "https://github.com/openfaas/org-tester",
    "description": "Temporary tester org.",
    "fork": false,
    "url": "https://api.github.com/repos/openfaas/org-tester",
    "forks_url": "https://api.github.com/repos/openfaas/org-tester/forks",
    "keys_url": "https://api.github.com/repos/openfaas/org-tester/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/openfaas/org-tester/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/openfaas/org-tester/teams",
    "hooks_url": "https://api.github.com/repos/openfaas/org-tester/hooks",
    "issue_events_url": "https://api.github.com/repos/openfaas/org-tester/issues/events{/number}",
    "events_url": "https://api.github.com/repos/openfaas/org-tester/events",
    "assignees_url": "https://api.github.com/repos/openfaas/org-tester/assignees{/user}",
    "branches_url": "https://api.github.com/repos/openfaas/org-tester/branches{/branch}",
    "tags_url": "https://api.github.com/repos/openfaas/org-tester/tags",
    "blobs_url": "https://api.github.com/repos/openfaas/org-tester/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/openfaas/org-tester/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/openfaas/org-tester/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/openfaas/org-tester/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/openfaas/org-tester/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/openfaas/org-tester/languages",
    "stargazers_url": "https://api.github.com/repos/openfaas/org-tester/stargazers",
    "contributors_url": "https://api.github.com/repos/openfaas/org-tester/contributors",
    "subscribers_url": "https://api.github.com/repos/openfaas/org-tester/subscribers",
    "subscription_url": "https://api.github.com/repos/openfaas/org-tester/subscription",
    "commits_url": "https://api.github.com/repos/openfaas/org-tester/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/openfaas/org-tester/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/openfaas/org-tester/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/openfaas/org-tester/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/openfaas/org-tester/contents/{+path}",
    "compare_url": "https://api.github.com/repos/openfaas/org-tester/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/openfaas/org-tester/merges",
    "archive_url": "https://api.github.com/repos/openfaas/org-tester/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/openfaas/org-tester/downloads",
    "issues_url": "https://api.github.com/repos/openfaas/org-tester/issues{/number}",
    "pulls_url": "https://api.github.com/repos/openfaas/org-tester/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/openfaas/org-tester/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/openfaas/org-tester/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/openfaas/org-tester/labels{/name}",
    "releases_url": "https://api.github.com/repos/openfaas/org-tester/releases{/id}",
    "deployments_url": "https://api.github.com/repos/openfaas/org-tester/deployments",
    "created_at": "2017-09-22T08:26:43Z",
    "updated_at": "2019-02-14T16:12:58Z",
    "pushed_at": "2019-11-01T12:12:46Z",
    "git_url": "git://github.com/openfaas/org-tester.git",
    "ssh_url": "git@github.com:openfaas/org-tester.git",
    "clone_url": "https://github.com/openfaas/org-tester.git",
    "svn_url": "https://github.com/openfaas/org-tester",
    "homepage": "",
    "size": 12,
    "stargazers_count": 5,
    "watchers_count": 5,
    "language": null,
    "has_issues": true,
    "has_projects": false,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 1,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 8,
    "license": null,
    "forks": 1,
    "open_issues": 8,
    "watchers": 5,
    "default_branch": "master"
  },
  "organization": {
    "login": "openfaas",
    "id": 27013154,
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjI3MDEzMTU0",
    "url": "https://api.github.com/orgs/openfaas",
    "repos_url": "https://api.github.com/orgs/openfaas/repos",
    "events_url": "https://api.github.com/orgs/openfaas/events",
    "hooks_url": "https://api.github.com/orgs/openfaas/hooks",
    "issues_url": "https://api.github.com/orgs/openfaas/issues",
    "members_url": "https://api.github.com/orgs/openfaas/members{/member}",
    "public_members_url": "https://api.github.com/orgs/openfaas/public_members{/member}",
    "avatar_url": "https://avatars3.githubusercontent.com/u/27013154?v=4",
    "description": "Serverless Functions Made Simple"
  },
  "sender": {
    "login": "alexellis",
    "id": 6358735,
    "node_id": "MDQ6VXNlcjYzNTg3MzU=",
    "avatar_url": "https://avatars1.githubusercontent.com/u/6358735?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/alexellis",
    "html_url": "https://github.com/alexellis",
    "followers_url": "https://api.github.com/users/alexellis/followers",
    "following_url": "https://api.github.com/users/alexellis/following{/other_user}",
    "gists_url": "https://api.github.com/users/alexellis/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/alexellis/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/alexellis/subscriptions",
    "organizations_url": "https://api.github.com/users/alexellis/orgs",
    "repos_url": "https://api.github.com/users/alexellis/repos",
    "events_url": "https://api.github.com/users/alexellis/events{/privacy}",
    "received_events_url": "https://api.github.com/users/alexellis/received_events",
    "type": "User",
    "site_admin": false
  }
}

Subsequent release after merging 1x PR

{
  "action": "published",
  "release": {
    "url": "https://api.github.com/repos/openfaas/org-tester/releases/21146523",
    "assets_url": "https://api.github.com/repos/openfaas/org-tester/releases/21146523/assets",
    "upload_url": "https://uploads.github.com/repos/openfaas/org-tester/releases/21146523/assets{?name,label}",
    "html_url": "https://github.com/openfaas/org-tester/releases/tag/0.1.1",
    "id": 21146523,
    "node_id": "MDc6UmVsZWFzZTIxMTQ2NTIz",
    "tag_name": "0.1.1",
    "target_commitish": "master",
    "name": "Next release",
    "draft": false,
    "author": {
      "login": "alexellis",
      "id": 6358735,
      "node_id": "MDQ6VXNlcjYzNTg3MzU=",
      "avatar_url": "https://avatars1.githubusercontent.com/u/6358735?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/alexellis",
      "html_url": "https://github.com/alexellis",
      "followers_url": "https://api.github.com/users/alexellis/followers",
      "following_url": "https://api.github.com/users/alexellis/following{/other_user}",
      "gists_url": "https://api.github.com/users/alexellis/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/alexellis/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/alexellis/subscriptions",
      "organizations_url": "https://api.github.com/users/alexellis/orgs",
      "repos_url": "https://api.github.com/users/alexellis/repos",
      "events_url": "https://api.github.com/users/alexellis/events{/privacy}",
      "received_events_url": "https://api.github.com/users/alexellis/received_events",
      "type": "User",
      "site_admin": false
    },
    "prerelease": false,
    "created_at": "2019-11-01T12:14:33Z",
    "published_at": "2019-11-01T12:14:51Z",
    "assets": [

    ],
    "tarball_url": "https://api.github.com/repos/openfaas/org-tester/tarball/0.1.1",
    "zipball_url": "https://api.github.com/repos/openfaas/org-tester/zipball/0.1.1",
    "body": ""
  },
  "repository": {
    "id": 104450599,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMDQ0NTA1OTk=",
    "name": "org-tester",
    "full_name": "openfaas/org-tester",
    "private": false,
    "owner": {
      "login": "openfaas",
      "id": 27013154,
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjI3MDEzMTU0",
      "avatar_url": "https://avatars3.githubusercontent.com/u/27013154?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/openfaas",
      "html_url": "https://github.com/openfaas",
      "followers_url": "https://api.github.com/users/openfaas/followers",
      "following_url": "https://api.github.com/users/openfaas/following{/other_user}",
      "gists_url": "https://api.github.com/users/openfaas/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/openfaas/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/openfaas/subscriptions",
      "organizations_url": "https://api.github.com/users/openfaas/orgs",
      "repos_url": "https://api.github.com/users/openfaas/repos",
      "events_url": "https://api.github.com/users/openfaas/events{/privacy}",
      "received_events_url": "https://api.github.com/users/openfaas/received_events",
      "type": "Organization",
      "site_admin": false
    },
    "html_url": "https://github.com/openfaas/org-tester",
    "description": "Temporary tester org.",
    "fork": false,
    "url": "https://api.github.com/repos/openfaas/org-tester",
    "forks_url": "https://api.github.com/repos/openfaas/org-tester/forks",
    "keys_url": "https://api.github.com/repos/openfaas/org-tester/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/openfaas/org-tester/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/openfaas/org-tester/teams",
    "hooks_url": "https://api.github.com/repos/openfaas/org-tester/hooks",
    "issue_events_url": "https://api.github.com/repos/openfaas/org-tester/issues/events{/number}",
    "events_url": "https://api.github.com/repos/openfaas/org-tester/events",
    "assignees_url": "https://api.github.com/repos/openfaas/org-tester/assignees{/user}",
    "branches_url": "https://api.github.com/repos/openfaas/org-tester/branches{/branch}",
    "tags_url": "https://api.github.com/repos/openfaas/org-tester/tags",
    "blobs_url": "https://api.github.com/repos/openfaas/org-tester/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/openfaas/org-tester/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/openfaas/org-tester/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/openfaas/org-tester/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/openfaas/org-tester/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/openfaas/org-tester/languages",
    "stargazers_url": "https://api.github.com/repos/openfaas/org-tester/stargazers",
    "contributors_url": "https://api.github.com/repos/openfaas/org-tester/contributors",
    "subscribers_url": "https://api.github.com/repos/openfaas/org-tester/subscribers",
    "subscription_url": "https://api.github.com/repos/openfaas/org-tester/subscription",
    "commits_url": "https://api.github.com/repos/openfaas/org-tester/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/openfaas/org-tester/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/openfaas/org-tester/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/openfaas/org-tester/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/openfaas/org-tester/contents/{+path}",
    "compare_url": "https://api.github.com/repos/openfaas/org-tester/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/openfaas/org-tester/merges",
    "archive_url": "https://api.github.com/repos/openfaas/org-tester/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/openfaas/org-tester/downloads",
    "issues_url": "https://api.github.com/repos/openfaas/org-tester/issues{/number}",
    "pulls_url": "https://api.github.com/repos/openfaas/org-tester/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/openfaas/org-tester/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/openfaas/org-tester/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/openfaas/org-tester/labels{/name}",
    "releases_url": "https://api.github.com/repos/openfaas/org-tester/releases{/id}",
    "deployments_url": "https://api.github.com/repos/openfaas/org-tester/deployments",
    "created_at": "2017-09-22T08:26:43Z",
    "updated_at": "2019-11-01T12:14:35Z",
    "pushed_at": "2019-11-01T12:14:51Z",
    "git_url": "git://github.com/openfaas/org-tester.git",
    "ssh_url": "git@github.com:openfaas/org-tester.git",
    "clone_url": "https://github.com/openfaas/org-tester.git",
    "svn_url": "https://github.com/openfaas/org-tester",
    "homepage": "",
    "size": 12,
    "stargazers_count": 5,
    "watchers_count": 5,
    "language": null,
    "has_issues": true,
    "has_projects": false,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 1,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 8,
    "license": null,
    "forks": 1,
    "open_issues": 8,
    "watchers": 5,
    "default_branch": "master"
  },
  "organization": {
    "login": "openfaas",
    "id": 27013154,
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjI3MDEzMTU0",
    "url": "https://api.github.com/orgs/openfaas",
    "repos_url": "https://api.github.com/orgs/openfaas/repos",
    "events_url": "https://api.github.com/orgs/openfaas/events",
    "hooks_url": "https://api.github.com/orgs/openfaas/hooks",
    "issues_url": "https://api.github.com/orgs/openfaas/issues",
    "members_url": "https://api.github.com/orgs/openfaas/members{/member}",
    "public_members_url": "https://api.github.com/orgs/openfaas/public_members{/member}",
    "avatar_url": "https://avatars3.githubusercontent.com/u/27013154?v=4",
    "description": "Serverless Functions Made Simple"
  },
  "sender": {
    "login": "alexellis",
    "id": 6358735,
    "node_id": "MDQ6VXNlcjYzNTg3MzU=",
    "avatar_url": "https://avatars1.githubusercontent.com/u/6358735?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/alexellis",
    "html_url": "https://github.com/alexellis",
    "followers_url": "https://api.github.com/users/alexellis/followers",
    "following_url": "https://api.github.com/users/alexellis/following{/other_user}",
    "gists_url": "https://api.github.com/users/alexellis/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/alexellis/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/alexellis/subscriptions",
    "organizations_url": "https://api.github.com/users/alexellis/orgs",
    "repos_url": "https://api.github.com/users/alexellis/repos",
    "events_url": "https://api.github.com/users/alexellis/events{/privacy}",
    "received_events_url": "https://api.github.com/users/alexellis/received_events",
    "type": "User",
    "site_admin": false
  }
}

Screenshot 2019-11-01 at 12 15 13

The release itself

{
  "url": "https://api.github.com/repos/openfaas/org-tester/releases/21146523",
  "assets_url": "https://api.github.com/repos/openfaas/org-tester/releases/21146523/assets",
  "upload_url": "https://uploads.github.com/repos/openfaas/org-tester/releases/21146523/assets{?name,label}",
  "html_url": "https://github.com/openfaas/org-tester/releases/tag/0.1.1",
  "id": 21146523,
  "node_id": "MDc6UmVsZWFzZTIxMTQ2NTIz",
  "tag_name": "0.1.1",
  "target_commitish": "master",
  "name": "Next release",
  "draft": false,
  "author": {
    "login": "alexellis",
    "id": 6358735,
    "node_id": "MDQ6VXNlcjYzNTg3MzU=",
    "avatar_url": "https://avatars1.githubusercontent.com/u/6358735?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/alexellis",
    "html_url": "https://github.com/alexellis",
    "followers_url": "https://api.github.com/users/alexellis/followers",
    "following_url": "https://api.github.com/users/alexellis/following{/other_user}",
    "gists_url": "https://api.github.com/users/alexellis/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/alexellis/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/alexellis/subscriptions",
    "organizations_url": "https://api.github.com/users/alexellis/orgs",
    "repos_url": "https://api.github.com/users/alexellis/repos",
    "events_url": "https://api.github.com/users/alexellis/events{/privacy}",
    "received_events_url": "https://api.github.com/users/alexellis/received_events",
    "type": "User",
    "site_admin": false
  },
  "prerelease": false,
  "created_at": "2019-11-01T12:14:33Z",
  "published_at": "2019-11-01T12:14:51Z",
  "assets": [],
  "tarball_url": "https://api.github.com/repos/openfaas/org-tester/tarball/0.1.1",
  "zipball_url": "https://api.github.com/repos/openfaas/org-tester/zipball/0.1.1",
  "body": ""
}