https://github.com/tmr08c/weekly-summary-cron-with-now
Application that leverages Now to create a lambda to generate a list of recently closed GitHub Pull Requests for an Organization.
https://github.com/tmr08c/weekly-summary-cron-with-now
easycron github-api now typescript zeit-lambdas zeit-now
Last synced: about 2 months ago
JSON representation
Application that leverages Now to create a lambda to generate a list of recently closed GitHub Pull Requests for an Organization.
- Host: GitHub
- URL: https://github.com/tmr08c/weekly-summary-cron-with-now
- Owner: tmr08c
- Created: 2019-05-25T22:23:54.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-01-04T12:54:34.000Z (over 2 years ago)
- Last Synced: 2024-04-14T10:06:21.082Z (about 1 year ago)
- Topics: easycron, github-api, now, typescript, zeit-lambdas, zeit-now
- Language: TypeScript
- Homepage: https://github-weekly-summary.tmr08c.now.sh
- Size: 940 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Weekly Summary Cron with Now
[](https://deploy.now.sh/?repo=https://github.com/tmr08c/weekly-sumary-cron-with-now&env=GITHUB_AUTH_TOKEN&env=SENDGRID_API_KEY)
This application uses [Now](https://zeit.co) to produce a [lambda](https://zeit.co/docs/v2/deployments/concepts/lambdas) that will generate a markdown-friendly list of recently closed pull requests for a given organization.
## API
This appliation will creat a lambda that responds to HTTP GET requests, and takes in the following query parameters:
### `organization`
* **Required**
* StringThis organization for which you which to fetch the last week of closed Pull Requests for. The `GITHUB_AUTH_TOKEN` provided must have access to the specified organization.
### `to`
* Optional
* String
* Comma separated list of email addressesIf provided, the function will send a copy of the generated list of recently closed Pull Requests to the email addresses specified. Email is sent using [SendGrid](https://sendgrid.com/) and requires `SENDGRID_API_KEY` to be set.
## Development
```bash
npm run dev
```### Environmental Variables
See [`.env.example`](https://github.com/tmr08c/weekly-sumary-cron-with-now/blob/master/.env.example) for a list of environmental variables to set.
#### Local
For local development, you can use a `.env` file:
```bash
cp .env.example .env
```#### Production
For production, we use [Zeit Now's secrets](https://zeit.co/docs/v2/deployments/environment-variables-and-secrets#securing-environment-variables-using-secrets). See [`now.json`](https://github.com/tmr08c/weekly-sumary-cron-with-now/blob/master/now.json#L5) for a list of secrets to set.
## Deployment
```bash
npm run deploy
```This assumes you have [installed Now locally](https://zeit.co/docs/v2/getting-started/installation/) and logged in.
### Reccomendation
Rather than manually checking the endpoint for the list of recently closed Pull Requests, we suggest leveraging [EasyCron](https://www.easycron.com/) to periodically hit you Now endpoint with a `to` query paramter to send yourself the list via email on your own schedule.