dependabot[bot] 0edddd70c8 build(deps-dev): bump the development-dependencies group with 2 updates (#197)
Bumps the development-dependencies group with 2 updates:
[esbuild](https://github.com/evanw/esbuild) and
[yaml](https://github.com/eemeli/yaml).

Updates `esbuild` from 0.24.0 to 0.24.2
<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.2</h2>
<ul>
<li>
<p>Fix regression with <code>--define</code> and
<code>import.meta</code> (<a
href="https://redirect.github.com/evanw/esbuild/issues/4010">#4010</a>,
<a
href="https://redirect.github.com/evanw/esbuild/issues/4012">#4012</a>,
<a
href="https://redirect.github.com/evanw/esbuild/pull/4013">#4013</a>)</p>
<p>The previous change in version 0.24.1 to use a more expression-like
parser for <code>define</code> values to allow quoted property names
introduced a regression that removed the ability to use
<code>--define:import.meta=...</code>. Even though <code>import</code>
is normally a keyword that can't be used as an identifier, ES modules
special-case the <code>import.meta</code> expression to behave like an
identifier anyway. This change fixes the regression.</p>
<p>This fix was contributed by <a
href="https://github.com/sapphi-red"><code>@​sapphi-red</code></a>.</p>
</li>
</ul>
<h2>v0.24.1</h2>
<ul>
<li>
<p>Allow <code>es2024</code> as a target in <code>tsconfig.json</code>
(<a
href="https://redirect.github.com/evanw/esbuild/issues/4004">#4004</a>)</p>
<p>TypeScript recently <a
href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/#support-for---target-es2024-and---lib-es2024">added
<code>es2024</code></a> as a compilation target, so esbuild now supports
this in the <code>target</code> field of <code>tsconfig.json</code>
files, such as in the following configuration file:</p>
<pre lang="json"><code>{
  &quot;compilerOptions&quot;: {
    &quot;target&quot;: &quot;ES2024&quot;
  }
}
</code></pre>
<p>As a reminder, the only thing that esbuild uses this field for is
determining whether or not to use legacy TypeScript behavior for class
fields. You can read more in <a
href="https://esbuild.github.io/content-types/#tsconfig-json">the
documentation</a>.</p>
<p>This fix was contributed by <a
href="https://github.com/billyjanitsch"><code>@​billyjanitsch</code></a>.</p>
</li>
<li>
<p>Allow automatic semicolon insertion after
<code>get</code>/<code>set</code></p>
<p>This change fixes a grammar bug in the parser that incorrectly
treated the following code as a syntax error:</p>
<pre lang="ts"><code>class Foo {
  get
  *x() {}
  set
  *y() {}
}
</code></pre>
<p>The above code will be considered valid starting with this release.
This change to esbuild follows a <a
href="https://redirect.github.com/microsoft/TypeScript/pull/60225">similar
change to TypeScript</a> which will allow this syntax starting with
TypeScript 5.7.</p>
</li>
<li>
<p>Allow quoted property names in <code>--define</code> and
<code>--pure</code> (<a
href="https://redirect.github.com/evanw/esbuild/issues/4008">#4008</a>)</p>
<p>The <code>define</code> and <code>pure</code> API options now accept
identifier expressions containing quoted property names. Previously all
identifiers in the identifier expression had to be bare identifiers.
This change now makes <code>--define</code> and <code>--pure</code>
consistent with <code>--global-name</code>, which already supported
quoted property names. For example, the following is now possible:</p>
<pre lang="js"><code>// The following code now transforms to
&quot;return true;\n&quot;
console.log(esbuild.transformSync(
  `return process.env['SOME-TEST-VAR']`,
  { define: { 'process.env[&quot;SOME-TEST-VAR&quot;]': 'true' } },
))
</code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</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.2</h2>
<ul>
<li>
<p>Fix regression with <code>--define</code> and
<code>import.meta</code> (<a
href="https://redirect.github.com/evanw/esbuild/issues/4010">#4010</a>,
<a
href="https://redirect.github.com/evanw/esbuild/issues/4012">#4012</a>,
<a
href="https://redirect.github.com/evanw/esbuild/pull/4013">#4013</a>)</p>
<p>The previous change in version 0.24.1 to use a more expression-like
parser for <code>define</code> values to allow quoted property names
introduced a regression that removed the ability to use
<code>--define:import.meta=...</code>. Even though <code>import</code>
is normally a keyword that can't be used as an identifier, ES modules
special-case the <code>import.meta</code> expression to behave like an
identifier anyway. This change fixes the regression.</p>
<p>This fix was contributed by <a
href="https://github.com/sapphi-red"><code>@​sapphi-red</code></a>.</p>
</li>
</ul>
<h2>0.24.1</h2>
<ul>
<li>
<p>Allow <code>es2024</code> as a target in <code>tsconfig.json</code>
(<a
href="https://redirect.github.com/evanw/esbuild/issues/4004">#4004</a>)</p>
<p>TypeScript recently <a
href="https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/#support-for---target-es2024-and---lib-es2024">added
<code>es2024</code></a> as a compilation target, so esbuild now supports
this in the <code>target</code> field of <code>tsconfig.json</code>
files, such as in the following configuration file:</p>
<pre lang="json"><code>{
  &quot;compilerOptions&quot;: {
    &quot;target&quot;: &quot;ES2024&quot;
  }
}
</code></pre>
<p>As a reminder, the only thing that esbuild uses this field for is
determining whether or not to use legacy TypeScript behavior for class
fields. You can read more in <a
href="https://esbuild.github.io/content-types/#tsconfig-json">the
documentation</a>.</p>
<p>This fix was contributed by <a
href="https://github.com/billyjanitsch"><code>@​billyjanitsch</code></a>.</p>
</li>
<li>
<p>Allow automatic semicolon insertion after
<code>get</code>/<code>set</code></p>
<p>This change fixes a grammar bug in the parser that incorrectly
treated the following code as a syntax error:</p>
<pre lang="ts"><code>class Foo {
  get
  *x() {}
  set
  *y() {}
}
</code></pre>
<p>The above code will be considered valid starting with this release.
This change to esbuild follows a <a
href="https://redirect.github.com/microsoft/TypeScript/pull/60225">similar
change to TypeScript</a> which will allow this syntax starting with
TypeScript 5.7.</p>
</li>
<li>
<p>Allow quoted property names in <code>--define</code> and
<code>--pure</code> (<a
href="https://redirect.github.com/evanw/esbuild/issues/4008">#4008</a>)</p>
<p>The <code>define</code> and <code>pure</code> API options now accept
identifier expressions containing quoted property names. Previously all
identifiers in the identifier expression had to be bare identifiers.
This change now makes <code>--define</code> and <code>--pure</code>
consistent with <code>--global-name</code>, which already supported
quoted property names. For example, the following is now possible:</p>
<pre lang="js"><code>// The following code now transforms to
&quot;return true;\n&quot;
console.log(esbuild.transformSync(
  `return process.env['SOME-TEST-VAR']`,
  { define: { 'process.env[&quot;SOME-TEST-VAR&quot;]': 'true' } },
</code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/evanw/esbuild/commit/745abd9f0c06f73ca40fbe198546a9bc36c23b81"><code>745abd9</code></a>
publish 0.24.2 to npm</li>
<li><a
href="https://github.com/evanw/esbuild/commit/79fd0b0ccc911a8e1571b83f25deec1b18d0ed10"><code>79fd0b0</code></a>
skip nulls in source map finalization (<a
href="https://redirect.github.com/evanw/esbuild/issues/4011">#4011</a>)</li>
<li><a
href="https://github.com/evanw/esbuild/commit/4b9322f723ce72b4d5fee6dc48d2a5e2c2e2d3bb"><code>4b9322f</code></a>
source map: avoid null entry for 0-length parts</li>
<li><a
href="https://github.com/evanw/esbuild/commit/199a0d38e4e4191e970f2a0a25e50e5c7ae36464"><code>199a0d3</code></a>
close <a
href="https://redirect.github.com/evanw/esbuild/issues/4013">#4013</a>:
credit to <a
href="https://github.com/sapphi-red"><code>@​sapphi-red</code></a> for
the fix</li>
<li><a
href="https://github.com/evanw/esbuild/commit/947f99fb085024ff711055d776b3982a75383d51"><code>947f99f</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/4010">#4010</a>,
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/4012">#4012</a>:
<code>import.meta</code> regression</li>
<li><a
href="https://github.com/evanw/esbuild/commit/de9598f42dc3ffc395e3fd3672a4804f6b4e5c09"><code>de9598f</code></a>
publish 0.24.1 to npm</li>
<li><a
href="https://github.com/evanw/esbuild/commit/15d56ca7d2196839c1d13a15fc214d6e81169e30"><code>15d56ca</code></a>
emit null source mappings for empty chunk content</li>
<li><a
href="https://github.com/evanw/esbuild/commit/8d98f6f6e663f7ecc9f0496edbd8bb8314b0333a"><code>8d98f6f</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3985">#3985</a>:
<code>entryPoint</code> metadata for <code>copy</code> loader</li>
<li><a
href="https://github.com/evanw/esbuild/commit/0db1b828bf69fa353f17e65837f2114d94b9e2c3"><code>0db1b82</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3998">#3998</a>:
avoid <code>outbase</code> in identifier names</li>
<li><a
href="https://github.com/evanw/esbuild/commit/723647263fcd0e4095e25a569e1d0a38f382768a"><code>7236472</code></a>
close <a
href="https://redirect.github.com/evanw/esbuild/issues/3974">#3974</a>:
add support for netbsd on arm64</li>
<li>Additional commits viewable in <a
href="https://github.com/evanw/esbuild/compare/v0.24.0...v0.24.2">compare
view</a></li>
</ul>
</details>
<br />

Updates `yaml` from 2.6.1 to 2.7.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/eemeli/yaml/releases">yaml's
releases</a>.</em></p>
<blockquote>
<h2>v2.7.0</h2>
<p>The library is now available on JSR as <a
href="https://jsr.io/@eemeli/yaml"><code>@​eemeli/yaml</code></a> and on
deno.land/x as <a href="https://deno.land/x/yaml">yaml</a>. In addition
to Node.js and browsers, it should work in Deno, Bun, and Cloudflare
Workers.</p>
<ul>
<li>Use .ts extension in all relative imports (<a
href="https://redirect.github.com/eemeli/yaml/issues/591">#591</a>)</li>
<li>Ignore newline after block seq indicator as space before value (<a
href="https://redirect.github.com/eemeli/yaml/issues/590">#590</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/eemeli/yaml/commit/8f512b526a52e245e770be257235f7d37059ca39"><code>8f512b5</code></a>
2.7.0</li>
<li><a
href="https://github.com/eemeli/yaml/commit/8a7569afff1a7add4560ed2e125eebab1f9683f1"><code>8a7569a</code></a>
ci: Add jsr.jsonc &amp; jsr-publish workflow</li>
<li><a
href="https://github.com/eemeli/yaml/commit/8ef085fa870f2b749e67ce52bb642afb796b7150"><code>8ef085f</code></a>
docs: Fix API docs links</li>
<li><a
href="https://github.com/eemeli/yaml/commit/374c19cfdc051ca81c5a1ce12ca733c2e2a9ec93"><code>374c19c</code></a>
style: Really use explicit imports for process.env and Buffer</li>
<li><a
href="https://github.com/eemeli/yaml/commit/1ab037d64674baf0265dfe6a57c5b3c8c2d5120a"><code>1ab037d</code></a>
style: Include explicit type declarations on all public APIs</li>
<li><a
href="https://github.com/eemeli/yaml/commit/4354c4233d7f75aed47a6d0ab74ab54867892b61"><code>4354c42</code></a>
style: Use explicit imports for process.env and Buffer</li>
<li><a
href="https://github.com/eemeli/yaml/commit/2c55723ab9f1d654d27deb2ed666d1c414a69013"><code>2c55723</code></a>
Merge pull request <a
href="https://redirect.github.com/eemeli/yaml/issues/591">#591</a> from
eemeli/import-ts</li>
<li><a
href="https://github.com/eemeli/yaml/commit/ab240c17d35bb808a6df8e3039b9ddd6a2de7ac4"><code>ab240c1</code></a>
fix: Drop .ts extension from import &amp; export paths in .d.ts
files</li>
<li><a
href="https://github.com/eemeli/yaml/commit/c4c49f9e95db811a6fe7fd529647cb2659f150d0"><code>c4c49f9</code></a>
fix: Use separate rather than inline type keyword for TS
compatibility</li>
<li><a
href="https://github.com/eemeli/yaml/commit/3bec004db4206ebb0d4551f981a7f9961077470b"><code>3bec004</code></a>
ci: Add deno smoke test</li>
<li>Additional commits viewable in <a
href="https://github.com/eemeli/yaml/compare/v2.6.1...v2.7.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>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2025-01-30 15:12:51 -08:00
2023-11-02 22:23:07 -07:00
2024-12-20 18:12:15 +00:00
2023-10-06 12:54:48 -07:00
2023-06-08 17:04:10 -07:00
2024-02-08 15:39:04 -08:00

Create GitHub App Token

test

GitHub Action for creating a GitHub App installation access token.

Usage

In order to use this action, you need to:

  1. Register new GitHub App
  2. Store the App's ID in your repository environment variables (example: APP_ID)
  3. 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 under https://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 owner is set and repositories is empty, access will be scoped to all repositories in the provided repository owner's installation. If owner and repositories are 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,

  1. The token is scoped to the current repository or repositories if set.
  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. Unless the skip-token-revoke input is set to a truthy value, 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.

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

MIT

S
Description
Mirror of github.com/actions/create-github-app-token (RFC #229 task #109)
Readme 8.1 MiB
Languages
JavaScript 100%