Skip to content

Support scripts for Github Apps, handy for machine-to-machine use-cases like CI/CD pipelines.

License

Notifications You must be signed in to change notification settings

putrafirman-fh/github-apps-support

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Github Apps Support

This project aims at providing scripts that help you in using Github Apps from services like Jenkins or Travis.

Getting started

Clone the project and make the scripts available to your $PATH for ease of use.

git clone https://github.com/navikt/github-apps-support.git
export PATH=`pwd`/github-apps-support/bin:$PATH

Getting an installation token

Generate an installation token by authenticating as a Github App using a signed JWT.

INSTALLATION_TOKEN=$(generate-installation-token.sh `generate-jwt.sh "$PRIVATE_KEY" $APP_ID`)

The private key must be kept secret, e.g. encrypting it and placing it in your code. Travis lets you do this quite easy via travis encrypt-files: https://docs.travis-ci.com/user/encrypting-files/

Depending on the permissions you set on your Github App you can now the installation token when communicating with the API or when pushing commits:

git clone https://x-access-token:<token>@github.com/owner/repo.git

Permissions

Unsure what permissions you need for the different API endpoints? Check out the documentation.

Creating commits on the command line

If you want to create commits using git, make sure you configure the committer with the name and email of your Github App. If you have an app called My Team then the name and email would be my-team[bot] and my-team[bot]@users.noreply.github.com

git config user.name my-team[bot]
git config user.email my-team[bot]@users.noreply.github.com

Requirements

Some of the scripts needs openssl and jq (both of which are pre-installed on Travis).

Contact

Code related questions may be asked using GitHub Issues.

About

Support scripts for Github Apps, handy for machine-to-machine use-cases like CI/CD pipelines.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%