Skip to content

A simple Python script to authenticate to GitHub as a GitHub App.

License

Notifications You must be signed in to change notification settings

vaspapadopoulos/github-app-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

github-app-auth

Python 3.9

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.

Get JWT for a GitHub App

Required environment variables:

  • GH_APP_ID The GitHub App ID
  • GH_APP_KEY The path for the GitHub App private key PEM file
$ GH_APP_ID=<app_id> GH_APP_KEY=<key> python main.py

Get installation access token for a GitHub App

Required environment variables:

  • GH_APP_ID The GitHub App ID
  • GH_APP_KEY The path for the GitHub App private key PEM file
  • GH_APP_INST_ID The GitHub App installation ID
$ GH_APP_ID=<app_id> GH_APP_KEY=<key> GH_APP_INST_ID=<app_inst_id> python main.py

About

A simple Python script to authenticate to GitHub as a GitHub App.

Topics

Resources

License

Stars

Watchers

Forks

Languages