Skip to content

Example: Using a GitHub App token instead of a PAT

Blackmoon edited this page May 17, 2026 · 2 revisions

First off, thank you for this action. It's a huge money-saver!

The README currently recommends a fine-grained Personal Access Token for github_token. I wanted to share that a GitHub App works as a drop-in replacement and is a better practice for org-wide use. Tokens are short-lived, there's no expiry to manage, and it's not tied to a personal account.

Here's the setup that works for me:

  1. Create a GitHub App with Repository permissions → Administration → Read and write
  2. Install the app on the relevant repositories (or org-wide)
  3. Add two org-wide or repo-wide secrets:
  • app's Client ID YOUR_APP_CLIENT_ID
  • its private key YOUR_APP_PRIVATE_KEY Private key must be in PKCS#8 format — convert from OpenSSH with ssh-keygen -p -m PKCS8 -f your-key.pem -N ""
  1. Generate a token in your workflow before calling this action:
  - name: Generate GitHub token
    id: generate_token
    uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
    with:
      app-id: ${{ secrets.YOUR_APP_CLIENT_ID }}
      private-key: ${{ secrets.YOUR_APP_PRIVATE_KEY }}

  - uses: wydler/hcloud-self-hosted-github-runner@c2a407295a3f3ccf0ca7473d0489849a8fd71354  # 1.0.0
    with:
      mode: create
      github_token: ${{ steps.generate_token.outputs.token }}

Could be worth a README mention if others are likely hitting the same setup?

Clone this wiki locally