Weekly Summary TypeScript
This package gets the last week of merged pull requests for a specific organization from GitHub.
Installing
npm install weekly-summary-typescript
Usage
Requsting pull requests
import { fetchRecentlyClosedPullRequests } from "weekly-summary-typescript";
const recentlyClosedPullRequests = await fetchRecentlyClosedPullRequests(
{
organization: `my-organization`
},
`my-github-auth-token`
);
Response
Pull requests are returned as an object where the key is the repository's name and the value is an array of objects that include information about the pull request. For example:
{
"weekly-summary-typescript": [
{
"repository": {
"name": "weekly-summary-typescript"
},
"title": "refactor(github): changes setup for GitHub auth token",
"createdAt": "2019-11-02T19:14:53Z",
"closedAt": "2019-11-03T10:58:15Z",
"url": "https://github.com/tmr08c/weekly-summary-typescript/pull/14",
"merged": true
},
{
"repository": {
"name": "weekly-summary-typescript"
},
"title": "chore: sets up commitizen",
"createdAt": "2019-11-02T19:00:06Z",
"closedAt": "2019-11-02T19:00:51Z",
"url": "https://github.com/tmr08c/weekly-summary-typescript/pull/13",
"merged": true
}
]
}
Type definitions can be found here.
You can also check out this project for an example of how this package is used in production.