Coder Social home page Coder Social logo

tmr08c / weekly-summary-cron-with-now Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 963 KB

Application that leverages Now to create a lambda to generate a list of recently closed GitHub Pull Requests for an Organization.

Home Page: https://github-weekly-summary.tmr08c.now.sh

TypeScript 99.14% JavaScript 0.86%
now zeit-now zeit-lambdas typescript easycron github-api

weekly-summary-cron-with-now's Introduction

Weekly Summary Cron with Now

Deploy to now

This application uses Now to produce a lambda 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
  • String

This 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 addresses

If 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 and requires SENDGRID_API_KEY to be set.

Development

npm run dev

Environmental Variables

See .env.example for a list of environmental variables to set.

Local

For local development, you can use a .env file:

cp .env.example .env

Production

For production, we use Zeit Now's secrets. See now.json for a list of secrets to set.

Deployment

npm run deploy

This assumes you have installed Now locally and logged in.

Reccomendation

Rather than manually checking the endpoint for the list of recently closed Pull Requests, we suggest leveraging EasyCron to periodically hit you Now endpoint with a to query paramter to send yourself the list via email on your own schedule.

weekly-summary-cron-with-now's People

Contributors

dependabot[bot] avatar tmr08c avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

roirevolution

weekly-summary-cron-with-now's Issues

Should this be re-written as a GitHub action?

Writing this as a GitHub action could allow it to be run on a schedule without having to leverage something like easycron.

Since this pulls in data from GitHub, it's probably safe to tie it to running on GitHub.

It also looks like using the @actions/github package could allow for API access to already be granted to people that set up the task (also meaning we'd need to change how we use https://github.com/tmr08c/weekly-summary-typescript).

Rather than sending an email, it could create an Issue (maybe we can leverage this action). This would reduce external dependencies.

Fix sending to multiple users

Currently, sending to multiple users doesn't work.

We are setting the to to a comma-separated string, but the packages wants an array.

We should update the code for setting to to be an array and update the README.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.