Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 1.24 KB

File metadata and controls

21 lines (13 loc) · 1.24 KB

This is an example GitHub App that adds a label to all new issues opened in a repository. You can follow the "Using GitHub API in your app" quickstart guide on developer.github.com to learn how to build the app code in server.rb.

This project listens for webhook events and uses the Octokit.rb library to make REST API calls. This example project consists of two different servers:

  • template_server.rb (GitHub App template code)
  • server.rb (completed project)

To learn how to set up a template GitHub App, follow the "Setting up your development environment" quickstart guide on developer.github.com.

Install

To run the code, make sure you have Bundler installed; then enter bundle install on the command line.

Set environment variables

  1. Create a copy of the .env-example file called .env.
  2. Add your GitHub App's private key, app ID, and webhook secret to the .env file.

Run the server

  1. Run ruby template_server.rb or ruby server.rb on the command line.
  2. View the default Sinatra app at localhost:3000.