# Three Ways to Generate a GitHub Token
## Metadata
**Status**:: #x
**Zettel**:: #zettel/literature
**Tags**:: #evergreen
**Created**:: [[2022-09-30]]
**Topic**:: [[♯ GitHub]]
## Synopsis
The GitHub Actions provided token only has the read and write permission to the current repository. If the workflow requires access to other data, such as projects in the organization, it must use a generated token with granted permissions.
## Generate a Personal Token Via a Personal Account
The personal account token is recommended for personal repositories.
1. In the upper-right corner of any page, click your profile photo, then click **Settings**.
2. In the left sidebar, click **Developer settings**.
3. In the left sidebar, click **Personal access tokens**.
## Generate a Personal Token Via a Shared Account
This is similar to personal account token, but using a shared account. A centralized organization can register a dedicated GitHub Account to generate tokens for automation.
## Generate a Token Via a GitHub App
Personal token has access to all the repositories visible to the account. It's easy to manage which repositories the GitHub App can access as well.
The following is a template from the official documentation _[[GitHub Authors - Automating Projects Using Actions (Highlights)|Automating Projects using Actions]]_ to generate a token via GitHub App in GitHub Actions.
```yaml
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: GitHub App Token Template
on:
pull_request: {}
jobs:
github-app-token-template:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PEM }}
- name: Use token
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
```
1. You can find `APP_ID` on the settings page of the GitHub App.
2. `APP_PEM` must include `-----BEGIN RSA PRIVATE KEY-----` and `-----END RSA PRIVATE KEY-----`.