Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
unlock

GitHub Action

GitHub App installation access token generator

v1.0.4

GitHub App installation access token generator

unlock

GitHub App installation access token generator

Generate an installation access token for a GitHub App that can be for instance used to clone other repositories

Installation

Copy and paste the following snippet into your .yml file.

              

- name: GitHub App installation access token generator

uses: navikt/[email protected]

Learn more about this action in navikt/github-app-token-generator

Choose a version

GitHub App installation access token generator

GitHub Action that can be used to generate an installation access token for a GitHub App. This token can for instance be used to clone repos, given the GitHub App has sufficient permissions to do so.

Usage

name: Checkout repos
on: push
jobs:
  checkout:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - uses: navikt/github-app-token-generator@v1
      id: get-token
      with:
        private-key: ${{ secrets.PRIVATE_KEY }}
        app-id: ${{ secrets.APP_ID }}

    - name: Check out an other repo
      uses: actions/checkout@v2
      with:
        repository: owner/repo
        token: ${{ steps.get-token.outputs.token }}

Requirements

The action needs two input parameters, private-key and app-id. To get these, simply create a GitHub App. The private key can be generated and downloaded, and should be added to the repos as a secret.