This action allow devops users to get a repository token from a githubapps. If the githubapps is installed on differents organizations, the organziation could be defined.
-
Set up Githubapps Credentials as secrets in the repository using (GITHUB_APP_IDENTIFIER and GITHUB_PRIVATE_KEY).
-
Add the following code in your repo
-
if you need a token for another organization of the current repository where the action is used. Include the args parameters.
uses: pzamoran/ghe-action-gettoken@v0.2.1
env:
GITHUB_APP_IDENTIFIER: ${{ env.APPLICATION_ID }}
GITHUB_PRIVATE_KEY: ${{ secrets.APPLICATION_PRIVATE_KEY }}
with:
args: '--github-organization <organization>'|
Important
|
The githubapps should have content permissions and should be installed on the requested organizations. |
GITHUB_APP_IDENTIFIER and GITHUB_PRIVATE_KEY could be injected to provided authentication with githubapp using environments or inside args inputs
Optional Get_token.py options, if you need to get a token from a specific organization: --github-organization <organization-name>. Default "World".
❯ python3 get_token.py -h
usage: get_token.py [-h] [--github-app-id GITHUB_APP_ID] [--github-app-key GITHUB_APP_KEY] [--github-organization GITHUB_ORG]
Get installation token from Githubapp
optional arguments:
-h, --help show this help message and exit
--github-app-id GITHUB_APP_ID
Github app ID
--github-app-key GITHUB_APP_KEY
Github app public key
--github-organization GITHUB_ORG
Github app organization
Pablo Andrés Zamorano Navarro <pablo.zamorano@gruposantander.com>.