Warning
Please note: This action has been archived and should no longer be used. Please, migrate your workflows to the actions/create-github-app-token, which is being actively maintained by the official GitHub organization.
This action makes it easy to get a token for your GitHub App.
Create a GitHub App and install it on the users or organizations you want to access from within Workflow.
Then, generate a private key and save it as is in encrypted secrets.
github_app_id
- ID of the GitHub App used to create the Access Tokengithub_app_private_key
- A private key of the GitHub App used to create the Access Token (Refers to the value stored in encrypted secrets)target_account
(Optional) - The target user or organization that you want to access with the token (Default: The owner of the repository in which the Workflow is running)
token
- An installation access token created
name: Using GitHub App token
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: cybozu/octoken-action@v1
id: create-iat
with:
github_app_id: 12345
github_app_private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
target_account: cybozu
- name: Use Installation Access Token
env:
IAT: ${{ steps.create-iat.outputs.token }}
run: |
curl --include --fail -H "Authorization: token ${IAT}" https://api.github.com/installation/repositories
The scripts and documentation in this project are released under the MIT License.