GitXplorerGitXplorer
M

gh_app_demo

public
34 stars
12 forks
2 issues

Commits

List of commits on branch master.
Unverified
d01dfc03719e57d1bbee7c849a3fe270be0e0cdb

Update aiohttp from 3.4.4 to 3.5.0 (#7)

ppyup-bot committed 6 years ago
Unverified
6a20d99bf44da5c96bd44c5713ee3f576bf5c4da

Update gidgethub from 3.0.0 to 3.1.0 (#6)

ppyup-bot committed 6 years ago
Unverified
4732747a1a8f37c6dd5e1526ef4dfbcfe124424c

Update pyjwt from 1.7.0 to 1.7.1 (#5)

ppyup-bot committed 6 years ago
Unverified
f68bfd1618d50c413d847ff71797d278c19a8024

create pyup.io config file (#4)

ppyup-bot committed 6 years ago
Verified
3dfa909866d5aa6f247b6801895a8efa7d0f3275

A better workaround, pass data=b"" to gh.post (#2)

MMariatta committed 6 years ago
Verified
ca2819cadebcf51ae324f474d44f4d218f8f076b

GitHub App demo (#1)

MMariatta committed 6 years ago

README

The README file for this repository.

GitHub App demo

Demo of a GitHub App using Python 3.7, gidgethub and aiohttp.

Other dependencies: pyjwt and cryptography.

See requirements.txt.

When the command line script is run, the GitHub App will open an issue in my repo: Mariatta/strange-relationship <https://github.com/mariatta/strange-relationship>_.

Example issue created by the GitHub App: https://github.com/Mariatta/strange-relationship/issues/144

GitHub App Creation

  1. Create a GitHub App (https://github.com/settings/apps/new)

    Give it the necessary permission. I gave "read & write" access to Issues.

  2. Have a user install the app.

  3. Record the App ID. It can be found in the App's settings under "About" heading.

  4. Generate a private key for the app. (https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#generating-a-private-key)

Local environment setup

  1. Install the dependencies, preferably using a virtual environment. For example::

    $ python3.7 -m venv venv $ source venv/bin/activate $ python -m pip install -U pip $ python -m pip install -r requirements.txt

  2. Create the environment variable GH_APP_ID. (obtained from GitHub App Creation step 3 ). For example::

    $ export GH_APP_ID=1235

  3. Create the environment variable PEM_FILE_PATH, that is the path to the private key file (downloaded in GitHub App Creation step 4). For example::

    $ export PEM_FILE_PATH=./my-app.2018-11-11.private-key.pem

  4. Run the command line script::

    $ python main.py