Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: actions/create-github-app-token
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.3
Choose a base ref
...
head repository: actions/create-github-app-token
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.4
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Aug 21, 2023

  1. docs(README): update title, description, formatting, and more (#11)

    - Update title
    - Remove blockquote formatting from description to improve accessibility
    - Capitalize "app" in "GitHub App" for consistency
    - Add missing periods in unordered list
    - Use new highlight syntax for note
    parkerbxyz authored Aug 21, 2023
    Copy the full SHA
    950f8a0 View commit details
  2. fix(action-config): prepare for release to marketplace (#10)

    https://github.com/marketplace/actions/github-app-token is taken, hence
    the rename
    
    ---------
    
    Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
    gr2m and parkerbxyz authored Aug 21, 2023
    Copy the full SHA
    12aa811 View commit details
Showing with 21 additions and 18 deletions.
  1. +9 −9 README.md
  2. +12 −9 action.yml
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `actions/github-app-token`
# Create GitHub App Token

> GitHub Action for creating a GitHub App Installation Access Token
GitHub Action for creating a GitHub App installation access token.

## Usage

@@ -61,29 +61,29 @@ jobs:

### `app_id`

**Required:** GitHub app ID.
**Required:** GitHub App ID.

### `private_key`

**Required:** GitHub app private key.
**Required:** GitHub App private key.

## Outputs

### `token`

GitHub installation access token.
GitHub App installation access token.

## How it works

The action creates an installation access token using [the `POST /app/installations/{installation_id}/access_tokens` endpoint](https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app). By default,

1. The token is scoped to the current repository
2. The token inherits all the installation's permissions
3. The token is set as output `token` which can be used in subsequent steps
1. The token is scoped to the current repository.
2. The token inherits all the installation's permissions.
3. The token is set as output `token` which can be used in subsequent steps.
4. The token is revoked in the `post` step of the action, which means it cannot be passed to another job.
5. The token is masked, it cannot be logged accidentally. That is not a feature by the action, but by the GitHub Actions runner itself, due to the specific format of GitHub tokens.

> **Note**
> [!NOTE]
> Installation permissions can differ from the app's permissions they belong to. Installation permissions are set when an app is installed on an account. When the app adds more permissions after the installation, an account administrator will have to approve the new permissions before they are set on the installation.

## License
21 changes: 12 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
name: 'github-app-token'
description: ''
author: 'Gregor Martynus and Parker Brown'
name: "Create GitHub App Token"
description: "GitHub Action for creating a GitHub App installation access token"
author: "Gregor Martynus and Parker Brown"
branding:
icon: "lock"
color: "gray-dark"
inputs:
app_id:
description: 'GitHub app ID'
description: "GitHub App ID"
required: true
private_key:
description: 'GitHub app private key'
description: "GitHub App private key"
required: true
outputs:
token:
description: 'GitHub installation access token'
description: "GitHub installation access token"
runs:
using: 'node16'
main: 'dist/main.cjs'
post: 'dist/post.cjs'
using: "node16"
main: "dist/main.cjs"
post: "dist/post.cjs"