github-access-using-githubapp
Once your GitHub App is installed on an account, you can make it authenticate as an app installation for API requests. This allows the app to access resources owned by that installation, as long as the app was granted the necessary repository access and permissions. API requests made by an app installation are attributed to the app.
📌 This action will help in creating GitHub app installation token for both user accounts and Github organizations
Important
An installation access token expires after 1 hour. Please find suitable alternative approaches if you have long-running processes..
| Parameter name | Description | Required |
|---|---|---|
| github_app_private_key | Github App Private key | ✔️ |
| github_app_id | Your GitHub App ID | ✔️ |
| owner | Github account owner name. if not specified takes owner of current repository where action is ran | ❌ |
| repositories | List of github repositores to generte token for. if not specified takes current repository where action is ran. | ❌ |
-
Store your
Github App IdandGithub App Private keyas github secret and pass the secret names as inputs for action. -
❌ 👉 Means optional values
Note
If the owner is set but repositories are empty, access will include all repositories for that owner. If both the owner and repositories are empty, access will be limited to the current repository.
Please refer to the release page for the latest release notes.
- uses: githubofkrishnadhas/github-access-using-githubapp@v1
with:
# Your GitHub App ID - interger value
github_app_id: 1234567
# GitHub App Private key
github_app_private_key : ''
# GitHub account Owner name - Optional
owner: ''
# GitHub repositories names seperated by comma if more than 1 - optional
repositories: ''
The token generated will be available as a Environment variable GH_APP_TOKEN which can be used while running api calls
- generating-an-installation-access-token
- get-a-user-installation-for-the-authenticated-app
- get-a-repository-installation-for-the-authenticated-app
All the above API's uses JWT as access token.