Skip to content

Get temporary GitHub API credentials using a GitHub App

License

Notifications You must be signed in to change notification settings

volkswagen/github-app-authentication-action

Repository files navigation

GitHub App Authentication Action

Get temporary GitHub API credentials using a GitHub App

Test System Test

Usage

First Create a GitHub App (Callback URL, OAuth-Flow and Webhook-Url is not necessary for this action) and add it to your GitHub Organization.

Example pipeline

name: Authenticate
on: [push]
jobs:
  example:
    runs-on: ubuntu-latest
    steps:
    - name: Authenticate
      id: authenticate
      uses: volkswagen/github-app-authentication-action@v1
      with:
        appId: ${{ secrets.APP_ID }}
        clientId: ${{ secrets.CLIENT_ID }}
        privateKey: ${{ secrets.PRIVATE_KEY }}
        installationId: ${{ secrets.INSTALLATION_ID }}
    - name: Another Job 
      uses: something_else
      with:
        token: ${{ steps.authenticate.outputs.token }}

Mandatory Arguments

appId is the app ID of the GitHub App (see App Settings > General > About)
clientId the client ID of the GitHub App (see App Settings > General > About, e.g. Iv1.*********)
privateKey the private key of the GitHub App
installationId the installation id of the GitHub App

Outputs

token is a token that can be used on the GitHub API