Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.14 KB

README.md

File metadata and controls

43 lines (33 loc) · 1.14 KB

App auth GitHub action

GitHub action for GitHub App authentication. It generates an auth token from app's private key to be used in some another workflow's step.

There already exists public action for this scenario. The reason for this action is I don't consider safe to send private key of the app to some external code which I don't control.

Usage

Put topmonks/app-auth-action@<VERSION> into uses key of the step.

Action has two inputs:

  • appId: ID of the GitHub app
  • appPrivateKey: Private key of the GitHub app

The generated token will be in steps output token.

Example:

name: Add issues to project

on:
  issues:
    types:
      - opened

jobs:
  add-to-project:
    name: Add issue to project
    runs-on: ubuntu-latest
    steps:
      - name: Get token
        id: get-token
        uses: topmonks/app-auth-action@v1
        with:
          appId: ${{ secrets.APP_ID }}
          appPrivateKey: ${{ secrets.APP_PRIVATE_KEY }}
      - name: Add issue to project
        uses: actions/[email protected]
        with:
          project-url: <PROJECT-URL>
          github-token: ${{ steps.get-token.outputs.token }}