Coder Social home page Coder Social logo

ghc's Introduction

GitHub API Interaction

A Node / Express endpoint that exposes a single route designed for invocation via a webhook that is triggered upon the creation of a new repository within a pre-configured GitHub organization. When called, it both restricts access to the master branch and provides a notification by assigning (and notifying within the body) a new GitHub Issue.

Installation

The service runs on Node.js which can be downloaded here. Once installed, you'll be able to install the dependencies with the following:

npm i

You'll also need to create a file called .env in the root of the project. This contains both the GitHub API key and the username of the individual you'd like to be notified upon creation of a repository. Copy and paste the following and update the API key and username respectively. Note that they don't need to be wrapped in quotes.

GH_API_KEY=yourapikey
GH_USERNAME=yourusername

Running Locally

With the necessary dependencies in place, you're now ready to run the service. Use the following command to start the service:

node index.js

Testing

To test the service from your local development environment, you can use ngrok to temporarily make your locally running web server publicly available. Once downloaded, you'll be able to run with the following command (for Unix-based Operating Systems) from the root of your project.

/Applications/ngrok http 3000

This will open an interface-tunnel such as http://066c8c2f.ngrok.io/ that you can paste into GitHub to test the webhook. Note that you'll need to include the /payload route, so the full URL will look something like this http://066c8c2f.ngrok.io/payload.

Deploying

To deploy to something more permanent (such as Heroku, AWS Lambda, or Azure Functions) the code is largely ready to go. You'll just need to follow the respective guidelines to setup the environment variables, install the dependencies, etc.

Dependencies

Note that the following 3rd party frameworks and libraries were used:

Questions

Any questions, feel free to reach out at [email protected].

ghc's People

Contributors

kevinbluer avatar

Watchers

James Cloos avatar

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.