Bumps the development-dependencies group with 3 updates: [@sinonjs/fake-timers](https://github.com/sinonjs/fake-timers), [esbuild](https://github.com/evanw/esbuild) and [execa](https://github.com/sindresorhus/execa). Updates `@sinonjs/fake-timers` from 13.0.1 to 13.0.2 <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/sinonjs/fake-timers/blob/main/CHANGELOG.md"><code>@sinonjs/fake-timers</code>'s changelog</a>.</em></p> <blockquote> <h1>13.0.2 / 2024-09-13</h1> <ul> <li>fix <a href="https://redirect.github.com/sinonjs/fake-timers/issues/504">#504</a>: make instances of original Date pass as instances of the fake Date (<a href="https://redirect.github.com/sinonjs/fake-timers/issues/505">#505</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/sinonjs/fake-timers/commit/78024200ae5eb0398310b133cfcc106b0250ecad"><code>7802420</code></a> 13.0.2</li> <li><a href="https://github.com/sinonjs/fake-timers/commit/b98dc757d9c2f86a4054b0f9d3c0b686e35424ff"><code>b98dc75</code></a> Updated release files for 13.0.2</li> <li><a href="https://github.com/sinonjs/fake-timers/commit/ae0a2665c68576387452dda1abae7425c1779416"><code>ae0a266</code></a> fix <a href="https://redirect.github.com/sinonjs/fake-timers/issues/504">#504</a>: make instances of original Date pass as instances of the fake Date ...</li> <li>See full diff in <a href="https://github.com/sinonjs/fake-timers/compare/v13.0.1...v13.0.2">compare view</a></li> </ul> </details> <br /> Updates `esbuild` from 0.23.1 to 0.24.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/evanw/esbuild/releases">esbuild's releases</a>.</em></p> <blockquote> <h2>v0.24.0</h2> <p><strong><em>This release deliberately contains backwards-incompatible changes.</em></strong> To avoid automatically picking up releases like this, you should either be pinning the exact version of <code>esbuild</code> in your <code>package.json</code> file (recommended) or be using a version range syntax that only accepts patch upgrades such as <code>^0.23.0</code> or <code>~0.23.0</code>. See npm's documentation about <a href="https://docs.npmjs.com/cli/v6/using-npm/semver/">semver</a> for more information.</p> <ul> <li> <p>Drop support for older platforms (<a href="https://redirect.github.com/evanw/esbuild/pull/3902">#3902</a>)</p> <p>This release drops support for the following operating system:</p> <ul> <li>macOS 10.15 Catalina</li> </ul> <p>This is because the Go programming language dropped support for this operating system version in Go 1.23, and this release updates esbuild from Go 1.22 to Go 1.23. Go 1.23 now requires macOS 11 Big Sur or later.</p> <p>Note that this only affects the binary esbuild executables that are published to the esbuild npm package. It's still possible to compile esbuild's source code for these older operating systems. If you need to, you can compile esbuild for yourself using an older version of the Go compiler (before Go version 1.23). That might look something like this:</p> <pre><code>git clone https://github.com/evanw/esbuild.git cd esbuild go build ./cmd/esbuild ./esbuild --version </code></pre> </li> <li> <p>Fix class field decorators in TypeScript if <code>useDefineForClassFields</code> is <code>false</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/3913">#3913</a>)</p> <p>Setting the <code>useDefineForClassFields</code> flag to <code>false</code> in <code>tsconfig.json</code> means class fields use the legacy TypeScript behavior instead of the standard JavaScript behavior. Specifically they use assign semantics instead of define semantics (e.g. setters are triggered) and fields without an initializer are not initialized at all. However, when this legacy behavior is combined with standard JavaScript decorators, TypeScript switches to always initializing all fields, even those without initializers. Previously esbuild incorrectly continued to omit field initializers for this edge case. These field initializers in this case should now be emitted starting with this release.</p> </li> <li> <p>Avoid incorrect cycle warning with <code>tsconfig.json</code> multiple inheritance (<a href="https://redirect.github.com/evanw/esbuild/issues/3898">#3898</a>)</p> <p>TypeScript 5.0 introduced multiple inheritance for <code>tsconfig.json</code> files where <code>extends</code> can be an array of file paths. Previously esbuild would incorrectly treat files encountered more than once when processing separate subtrees of the multiple inheritance hierarchy as an inheritance cycle. With this release, <code>tsconfig.json</code> files containing this edge case should work correctly without generating a warning.</p> </li> <li> <p>Handle Yarn Plug'n'Play stack overflow with <code>tsconfig.json</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/3915">#3915</a>)</p> <p>Previously a <code>tsconfig.json</code> file that <code>extends</code> another file in a package with an <code>exports</code> map could cause a stack overflow when Yarn's Plug'n'Play resolution was active. This edge case should work now starting with this release.</p> </li> <li> <p>Work around more issues with Deno 1.31+ (<a href="https://redirect.github.com/evanw/esbuild/pull/3917">#3917</a>)</p> <p>This version of Deno broke the <code>stdin</code> and <code>stdout</code> properties on command objects for inherited streams, which matters when you run esbuild's Deno module as the entry point (i.e. when <code>import.meta.main</code> is <code>true</code>). Previously esbuild would crash in Deno 1.31+ if you ran esbuild like that. This should be fixed starting with this release.</p> <p>This fix was contributed by <a href="https://github.com/Joshix-1"><code>@Joshix-1</code></a>.</p> </li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/evanw/esbuild/blob/main/CHANGELOG.md">esbuild's changelog</a>.</em></p> <blockquote> <h2>0.24.0</h2> <p><strong><em>This release deliberately contains backwards-incompatible changes.</em></strong> To avoid automatically picking up releases like this, you should either be pinning the exact version of <code>esbuild</code> in your <code>package.json</code> file (recommended) or be using a version range syntax that only accepts patch upgrades such as <code>^0.23.0</code> or <code>~0.23.0</code>. See npm's documentation about <a href="https://docs.npmjs.com/cli/v6/using-npm/semver/">semver</a> for more information.</p> <ul> <li> <p>Drop support for older platforms (<a href="https://redirect.github.com/evanw/esbuild/pull/3902">#3902</a>)</p> <p>This release drops support for the following operating system:</p> <ul> <li>macOS 10.15 Catalina</li> </ul> <p>This is because the Go programming language dropped support for this operating system version in Go 1.23, and this release updates esbuild from Go 1.22 to Go 1.23. Go 1.23 now requires macOS 11 Big Sur or later.</p> <p>Note that this only affects the binary esbuild executables that are published to the esbuild npm package. It's still possible to compile esbuild's source code for these older operating systems. If you need to, you can compile esbuild for yourself using an older version of the Go compiler (before Go version 1.23). That might look something like this:</p> <pre><code>git clone https://github.com/evanw/esbuild.git cd esbuild go build ./cmd/esbuild ./esbuild --version </code></pre> </li> <li> <p>Fix class field decorators in TypeScript if <code>useDefineForClassFields</code> is <code>false</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/3913">#3913</a>)</p> <p>Setting the <code>useDefineForClassFields</code> flag to <code>false</code> in <code>tsconfig.json</code> means class fields use the legacy TypeScript behavior instead of the standard JavaScript behavior. Specifically they use assign semantics instead of define semantics (e.g. setters are triggered) and fields without an initializer are not initialized at all. However, when this legacy behavior is combined with standard JavaScript decorators, TypeScript switches to always initializing all fields, even those without initializers. Previously esbuild incorrectly continued to omit field initializers for this edge case. These field initializers in this case should now be emitted starting with this release.</p> </li> <li> <p>Avoid incorrect cycle warning with <code>tsconfig.json</code> multiple inheritance (<a href="https://redirect.github.com/evanw/esbuild/issues/3898">#3898</a>)</p> <p>TypeScript 5.0 introduced multiple inheritance for <code>tsconfig.json</code> files where <code>extends</code> can be an array of file paths. Previously esbuild would incorrectly treat files encountered more than once when processing separate subtrees of the multiple inheritance hierarchy as an inheritance cycle. With this release, <code>tsconfig.json</code> files containing this edge case should work correctly without generating a warning.</p> </li> <li> <p>Handle Yarn Plug'n'Play stack overflow with <code>tsconfig.json</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/3915">#3915</a>)</p> <p>Previously a <code>tsconfig.json</code> file that <code>extends</code> another file in a package with an <code>exports</code> map could cause a stack overflow when Yarn's Plug'n'Play resolution was active. This edge case should work now starting with this release.</p> </li> <li> <p>Work around more issues with Deno 1.31+ (<a href="https://redirect.github.com/evanw/esbuild/pull/3917">#3917</a>)</p> <p>This version of Deno broke the <code>stdin</code> and <code>stdout</code> properties on command objects for inherited streams, which matters when you run esbuild's Deno module as the entry point (i.e. when <code>import.meta.main</code> is <code>true</code>). Previously esbuild would crash in Deno 1.31+ if you ran esbuild like that. This should be fixed starting with this release.</p> <p>This fix was contributed by <a href="https://github.com/Joshix-1"><code>@Joshix-1</code></a>.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/evanw/esbuild/commit/d34e79e2a998c21bb71d57b92b0017ca11756912"><code>d34e79e</code></a> publish 0.24.0 to npm</li> <li><a href="https://github.com/evanw/esbuild/commit/045a87f164b31838aad7e2bcba112cf7717898d0"><code>045a87f</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3887">#3887</a>: omit dead export warning for <code>default</code></li> <li><a href="https://github.com/evanw/esbuild/commit/6e049b81d2e080ccdf24db84a71934ea736879ce"><code>6e049b8</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3913">#3913</a>: useDefineForClassFields and decorators</li> <li><a href="https://github.com/evanw/esbuild/commit/9c26f987dd9bbd33861a86b2a9d0b347f9ec297e"><code>9c26f98</code></a> lower decorators for useDefineForClassFields <a href="https://redirect.github.com/evanw/esbuild/issues/3913">#3913</a></li> <li><a href="https://github.com/evanw/esbuild/commit/46fdb686e2880f5b8447f998dedfc730e66ae32a"><code>46fdb68</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3898">#3898</a>: incorrect cyclic tsconfig.json warning</li> <li><a href="https://github.com/evanw/esbuild/commit/b50044303b3430ce007ac0fe4baf21160093794e"><code>b500443</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3917">#3917</a>: running esbuild cli with deno</li> <li><a href="https://github.com/evanw/esbuild/commit/b125e62c7033e3ace20df9ec05c846d222f61ce5"><code>b125e62</code></a> run <code>make update-compat-table</code></li> <li><a href="https://github.com/evanw/esbuild/commit/112b9aa32ea80eeef01cb91a8b415cfff08ef850"><code>112b9aa</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3915">#3915</a>: stack overflow with yarn + tsconfig</li> <li><a href="https://github.com/evanw/esbuild/commit/ed5a555488a18e3b48954506e98d1f6a51f53368"><code>ed5a555</code></a> wasm: catch and rethrow stack overflows (<a href="https://redirect.github.com/evanw/esbuild/issues/3915">#3915</a>)</li> <li><a href="https://github.com/evanw/esbuild/commit/11d3196156b12b11a3dc68f9d00a4a9982b907c0"><code>11d3196</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3902">#3902</a>: update go 1.22.5 => 1.23.1</li> <li>Additional commits viewable in <a href="https://github.com/evanw/esbuild/compare/v0.23.1...v0.24.0">compare view</a></li> </ul> </details> <br /> Updates `execa` from 9.3.1 to 9.4.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/sindresorhus/execa/releases">execa's releases</a>.</em></p> <blockquote> <h2>v9.4.0</h2> <h2>Features</h2> <ul> <li>We've created a separate package called <a href="https://github.com/sindresorhus/nano-spawn">nano-spawn</a>. It is similar to Execa but with fewer features, for a much smaller package size. <a href="https://github.com/sindresorhus/execa/blob/main/docs/small.md">More info.</a></li> </ul> <h2>Bug fixes</h2> <ul> <li>Both <a href="https://github.com/sindresorhus/execa/blob/main/docs/node.md"><code>execaNode()</code></a> and the <a href="https://github.com/sindresorhus/execa/blob/main/docs/environment.md#local-binaries"><code>preferLocal</code></a> option modify the <code>PATH</code> environment variable. This release includes some minor improvements to ensure that environment variable remains small (<a href="https://redirect.github.com/sindresorhus/npm-run-path/pull/20">sindresorhus/npm-run-path#20</a>). It also handles a few related edge cases better (<a href="https://redirect.github.com/sindresorhus/npm-run-path/pull/21">sindresorhus/npm-run-path#21</a>).</li> </ul> <h2>Documentation</h2> <ul> <li>Small documentation typo fix, thanks <a href="https://github.com/rrthomas"><code>@rrthomas</code></a>! (<a href="https://redirect.github.com/sindresorhus/execa/issues/1153">#1153</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/sindresorhus/execa/commit/1b9b9bbf17705c28019f770cecd9920db206f824"><code>1b9b9bb</code></a> 9.4.0</li> <li><a href="https://github.com/sindresorhus/execa/commit/ba483e74adcdd1cb0deafaed7f834f9c2340a326"><code>ba483e7</code></a> Upgrade <code>npm-run-path</code> (<a href="https://redirect.github.com/sindresorhus/execa/issues/1156">#1156</a>)</li> <li><a href="https://github.com/sindresorhus/execa/commit/eb3cfbac903b47607c58407d41078c59cb50dbe8"><code>eb3cfba</code></a> Add documentation about nano-spawn (<a href="https://redirect.github.com/sindresorhus/execa/issues/1157">#1157</a>)</li> <li><a href="https://github.com/sindresorhus/execa/commit/3fc804916d60b0b2e774a3642bd9815388caf7af"><code>3fc8049</code></a> Fix a typo (<a href="https://redirect.github.com/sindresorhus/execa/issues/1153">#1153</a>)</li> <li><a href="https://github.com/sindresorhus/execa/commit/c4cb62a463625d21eba1df8332ecd613455600cd"><code>c4cb62a</code></a> Improve documentation for <code>windowsVerbatimArguments</code> (<a href="https://redirect.github.com/sindresorhus/execa/issues/1149">#1149</a>)</li> <li>See full diff in <a href="https://github.com/sindresorhus/execa/compare/v9.3.1...v9.4.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Create GitHub App Token
GitHub Action for creating a GitHub App installation access token.
Usage
In order to use this action, you need to:
- Register new GitHub App
- Store the App's ID in your repository environment variables (example:
APP_ID) - Store the App's private key in your repository secrets (example:
PRIVATE_KEY)
Important
An installation access token expires after 1 hour. Please see this comment for alternative approaches if you have long-running processes.
Create a token for the current repository
name: Run tests on staging
on:
push:
branches:
- main
jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- uses: ./actions/staging-tests
with:
token: ${{ steps.app-token.outputs.token }}
Use app token with actions/checkout
on: [pull_request]
jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.head_ref }}
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false
- uses: creyD/prettier_action@v4.3
with:
github_token: ${{ steps.app-token.outputs.token }}
Create a git committer string for an app installation
on: [pull_request]
jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- id: committer
run: echo "string=${{ steps.app-token.outputs.app-slug }}[bot] <${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT"
- run: echo "committer string is ${ {steps.committer.outputs.string }}"
Configure git CLI for an app's bot user
on: [pull_request]
jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
# git commands like commit work using the bot user
- run: |
git add .
git commit -m "Auto-generated changes"
git push
Tip
The
<BOT USER ID>is the numeric user ID of the app's bot user, which can be found underhttps://api.github.com/users/<app-slug>%5Bbot%5D.For example, we can check at
https://api.github.com/users/dependabot[bot]to see the user ID of Dependabot is 49699333.Alternatively, you can use the octokit/request-action to get the ID.
Create a token for all repositories in the current owner's installation
on: [workflow_dispatch]
jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
body: "Hello, World!"
Create a token for multiple repositories in the current owner's installation
on: [issues]
jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
repo1
repo2
- uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
body: "Hello, World!"
Create a token for all repositories in another owner's installation
on: [issues]
jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: another-owner
- uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
body: "Hello, World!"
Create tokens for multiple user or organization accounts
You can use a matrix strategy to create tokens for multiple user or organization accounts.
Note
See this documentation for information on using multiline strings in workflows.
on: [workflow_dispatch]
jobs:
set-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set.outputs.matrix }}
steps:
- id: set
run: echo 'matrix=[{"owner":"owner1"},{"owner":"owner2","repos":["repo1"]}]' >>"$GITHUB_OUTPUT"
use-matrix:
name: "@${{ matrix.owners-and-repos.owner }} installation"
needs: [set-matrix]
runs-on: ubuntu-latest
strategy:
matrix:
owners-and-repos: ${{ fromJson(needs.set-matrix.outputs.matrix) }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ matrix.owners-and-repos.owner }}
repositories: ${{ join(matrix.owners-and-repos.repos) }}
- uses: octokit/request-action@v2.x
id: get-installation-repositories
with:
route: GET /installation/repositories
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
- run: echo "$MULTILINE_JSON_STRING"
env:
MULTILINE_JSON_STRING: ${{ steps.get-installation-repositories.outputs.data }}
Run the workflow in a github.com repository against an organization in GitHub Enterprise Server
on: [push]
jobs:
create_issue:
runs-on: self-hosted
steps:
- name: Create GitHub App token
id: create_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GHES_APP_ID }}
private-key: ${{ secrets.GHES_APP_PRIVATE_KEY }}
owner: ${{ vars.GHES_INSTALLATION_ORG }}
github-api-url: ${{ vars.GITHUB_API_URL }}
- name: Create issue
uses: octokit/request-action@v2.x
with:
route: POST /repos/${{ github.repository }}/issues
title: "New issue from workflow"
body: "This is a new issue created from a GitHub Action workflow."
env:
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
Inputs
app-id
Required: GitHub App ID.
private-key
Required: GitHub App private key. Escaped newlines (\\n) will be automatically replaced with actual newlines.
Some other actions may require the private key to be Base64 encoded. To avoid recreating a new secret, it can be decoded on the fly, but it needs to be managed securely. Here is an example of how this can be achieved:
steps:
- name: Decode the GitHub App Private Key
id: decode
run: |
private_key=$(echo "${{ secrets.PRIVATE_KEY }}" | base64 -d | awk 'BEGIN {ORS="\\n"} {print}' | head -c -2) &> /dev/null
echo "::add-mask::$private_key"
echo "private-key=$private_key" >> "$GITHUB_OUTPUT"
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ steps.decode.outputs.private-key }}
owner
Optional: The owner of the GitHub App installation. If empty, defaults to the current repository owner.
repositories
Optional: Comma or newline-separated list of repositories to grant access to.
Note
If
owneris set andrepositoriesis empty, access will be scoped to all repositories in the provided repository owner's installation. Ifownerandrepositoriesare empty, access will be scoped to only the current repository.
skip-token-revoke
Optional: If truthy, the token will not be revoked when the current job is complete.
github-api-url
Optional: The URL of the GitHub REST API. Defaults to the URL of the GitHub Rest API where the workflow is run from.
Outputs
token
GitHub App installation access token.
installation-id
GitHub App installation ID.
app-slug
GitHub App slug.
How it works
The action creates an installation access token using the POST /app/installations/{installation_id}/access_tokens endpoint. By default,
- The token is scoped to the current repository or
repositoriesif set. - The token inherits all the installation's permissions.
- The token is set as output
tokenwhich can be used in subsequent steps. - Unless the
skip-token-revokeinput is set to a truthy value, the token is revoked in thepoststep of the action, which means it cannot be passed to another job. - The token is masked, it cannot be logged accidentally.
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.