Coder Social home page Coder Social logo

gh-app-starter-python's Introduction

Python GitHub App

This app is meant to serve as an application to help you onboard to the GitHub ecosystem and start using GitHub Webhooks & Apps.

Getting Started

Initial Project Setup

  • Clone/Fork this repo
  • Generate your virutal environment
python3 -m venv venv
  • Activate your environment
source venv/bin/activate
  • Install dependencies
pip3 install -r requirements.txt
  • Run the app
flask run

Connecting to GitHub

  • Create a new public repository at https://github.com/new
  • Visit https://smee.io/ and click on Start a new Channel and note the URL
  • Create a new GitHub App - https://github.com/settings/apps/new
  • Give it a distinct name and description (prefix your LDAP)
  • Set Homepage URL = http://localhost:5000/
  • Set User authorization callback URL = http://localhost:5000/authenticate/
  • Check the checkbox for Request user authorization (OAuth) during installation
  • Set Webhook URL = <SMEE_URL>
  • Select the Radio Button for Enable SSL verification
  • Under permissions, give Read & Write permissions for Pull Requests
  • Under Subscribe to Events, check Pull Request
  • Generate and Download the Private key, move it to your app folder on local machine and name it ./private/gh-app.key
  • Hit Save Changes

Now you should be redirected to the App Settings -

  • Under the General tab on the left, find out your App ID

  • Append this App ID to User authorization callback URL, for instance, https://localhost:5000/authenticate/40221

  • Hit Save Changes

  • Go to the Install tab and install the application on only your repository.

  • If you were redirected to GitHub Home Page, your app installation was successful.

  • Open a new terminal window and navigate to where you checked out this repo and activate virual environment as above - source venv/bin/activate

  • Run pysmee forward <SMEE_URL> http://127.0.0.1:5000/webhook - this will forward all events to your app.

See it in action

  • Go ahead and create a new Pull Request in the repository you just added the webhook to
  • Voila! A new comment should be added to it.

Legal

© 2019 LinkedIn

gh-app-starter-python's People

Contributors

mike-north avatar princeshekhar avatar

Watchers

 avatar  avatar

gh-app-starter-python's Issues

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.