This app is meant to serve as an application to help you onboard to the GitHub ecosystem and start using GitHub Webhooks & Apps.
- 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
- Create a new public repository at https://github.com/new
- Visit https://smee.io/ and click on
Start a new Channeland 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 & Writepermissions forPull Requests - Under
Subscribe to Events, checkPull 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
Generaltab on the left, find out yourApp ID -
Append this
App IDtoUser authorization callback URL, for instance,https://localhost:5000/authenticate/40221 -
Hit
Save Changes -
Go to the
Installtab and install the application ononlyyour 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.
- 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.
© 2019 LinkedIn