This CircleCI Orb can be used to impersonate a GitHub App when secrets.GITHUB_TOKEN's limitations are too restrictive and a personal access token is not suitable.
- Create GitHub App. Follow the instruction here
- Get, App Id, Installation Id, and Private Key
- encode your private key to base64. run
base64 xxxxxxx.xxxxxxx.private-key.pem | cat
- Edit your .circleci/config.yml to get it ready.
version: '2.1'
orbs:
github-app-token: ostk0069/[email protected]
workflows:
use-my-orb:
jobs:
- github-app-token/fetch-token:
app_id: << your app id >>
base64_private_key: << your private key >>
installation_id: << your installation id >>
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
app_id | ID of the GitHub App | Yes | - | string |
base64_private_key | Base64 encoded Private key of the GitHub App | Yes | - | string |
env_name | Enable to Customize Token ENV Name | No | GITHUB_APP_TOKEN | string |
installation_id | The ID of the installation for which the token will be requested (defaults to the ID of the repository's installation) | Yes | - | integer |
repository_name | GitHub Repository Name | No | "" | string |
CircleCI Orb Registry Page - The official registry page of this orb for all versions, executors, commands, and jobs described.
CircleCI Orb Docs - Docs for using, creating, and publishing CircleCI Orbs.
We welcome issues to and pull requests against this repository!