A simple Python script to authenticate to GitHub as a GitHub App.
The script is based on the Ruby script found in Authenticating as a GitHub App . The script requires the GitHub App ID and the path of the PEM-formatted private key and generates the encoded JWT token.
Required environment variables:
GH_APP_IDThe GitHub App IDGH_APP_KEYThe path for the GitHub App private key PEM file
$ GH_APP_ID=<app_id> GH_APP_KEY=<key> python main.pyRequired environment variables:
GH_APP_IDThe GitHub App IDGH_APP_KEYThe path for the GitHub App private key PEM fileGH_APP_INST_IDThe GitHub App installation ID
$ GH_APP_ID=<app_id> GH_APP_KEY=<key> GH_APP_INST_ID=<app_inst_id> python main.py