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.20.1 to 0.20.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.20.2</h2> <ul> <li> <p>Support TypeScript experimental decorators on <code>abstract</code> class fields (<a href="https://redirect.github.com/evanw/esbuild/issues/3684">#3684</a>)</p> <p>With this release, you can now use TypeScript experimental decorators on <code>abstract</code> class fields. This was silently compiled incorrectly in esbuild 0.19.7 and below, and was an error from esbuild 0.19.8 to esbuild 0.20.1. Code such as the following should now work correctly:</p> <pre lang="ts"><code>// Original code const log = (x: any, y: string) => console.log(y) abstract class Foo { @log abstract foo: string } new class extends Foo { foo = '' } <p>// Old output (with --loader=ts --tsconfig-raw={&quot;compilerOptions&quot;:{&quot;experimentalDecorators&quot;:true}}) const log = (x, y) => console.log(y); class Foo { } new class extends Foo { foo = ""; }();</p> <p>// New output (with --loader=ts --tsconfig-raw={&quot;compilerOptions&quot;:{&quot;experimentalDecorators&quot;:true}}) const log = (x, y) => console.log(y); class Foo { } __decorateClass([ log ], Foo.prototype, "foo", 2); new class extends Foo { foo = ""; }(); </code></pre></p> </li> <li> <p>JSON loader now preserves <code>__proto__</code> properties (<a href="https://redirect.github.com/evanw/esbuild/issues/3700">#3700</a>)</p> <p>Copying JSON source code into a JavaScript file will change its meaning if a JSON object contains the <code>__proto__</code> key. A literal <code>__proto__</code> property in a JavaScript object literal sets the prototype of the object instead of adding a property named <code>__proto__</code>, while a literal <code>__proto__</code> property in a JSON object literal just adds a property named <code>__proto__</code>. With this release, esbuild will now work around this problem by converting JSON to JavaScript with a computed property key in this case:</p> <pre lang="js"><code>// Original code import data from 'data:application/json,{"__proto__":{"fail":true}}' if (Object.getPrototypeOf(data)?.fail) throw 'fail' <p>// Old output (with --bundle) (() => { // <data:application/json,{"<strong>proto</strong>":{"fail":true}}> var json_proto_fail_true_default = { <strong>proto</strong>: { fail: true } };</p> <p>// entry.js if (Object.getPrototypeOf(json_proto_fail_true_default)?.fail) throw "fail"; })();</p> <p></code></pre></p> </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.20.2</h2> <ul> <li> <p>Support TypeScript experimental decorators on <code>abstract</code> class fields (<a href="https://redirect.github.com/evanw/esbuild/issues/3684">#3684</a>)</p> <p>With this release, you can now use TypeScript experimental decorators on <code>abstract</code> class fields. This was silently compiled incorrectly in esbuild 0.19.7 and below, and was an error from esbuild 0.19.8 to esbuild 0.20.1. Code such as the following should now work correctly:</p> <pre lang="ts"><code>// Original code const log = (x: any, y: string) => console.log(y) abstract class Foo { @log abstract foo: string } new class extends Foo { foo = '' } <p>// Old output (with --loader=ts --tsconfig-raw={&quot;compilerOptions&quot;:{&quot;experimentalDecorators&quot;:true}}) const log = (x, y) => console.log(y); class Foo { } new class extends Foo { foo = ""; }();</p> <p>// New output (with --loader=ts --tsconfig-raw={&quot;compilerOptions&quot;:{&quot;experimentalDecorators&quot;:true}}) const log = (x, y) => console.log(y); class Foo { } __decorateClass([ log ], Foo.prototype, "foo", 2); new class extends Foo { foo = ""; }(); </code></pre></p> </li> <li> <p>JSON loader now preserves <code>__proto__</code> properties (<a href="https://redirect.github.com/evanw/esbuild/issues/3700">#3700</a>)</p> <p>Copying JSON source code into a JavaScript file will change its meaning if a JSON object contains the <code>__proto__</code> key. A literal <code>__proto__</code> property in a JavaScript object literal sets the prototype of the object instead of adding a property named <code>__proto__</code>, while a literal <code>__proto__</code> property in a JSON object literal just adds a property named <code>__proto__</code>. With this release, esbuild will now work around this problem by converting JSON to JavaScript with a computed property key in this case:</p> <pre lang="js"><code>// Original code import data from 'data:application/json,{"__proto__":{"fail":true}}' if (Object.getPrototypeOf(data)?.fail) throw 'fail' <p>// Old output (with --bundle) (() => { // <data:application/json,{"<strong>proto</strong>":{"fail":true}}> var json_proto_fail_true_default = { <strong>proto</strong>: { fail: true } };</p> <p>// entry.js if (Object.getPrototypeOf(json_proto_fail_true_default)?.fail) throw "fail"; })(); </code></pre></p> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="617eddaa32"><code>617edda</code></a> publish 0.20.2 to npm</li> <li><a href="4780075ace"><code>4780075</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3700">#3700</a>: json loader preserves <code>__proto__</code> keys</li> <li><a href="30bed2d2d7"><code>30bed2d</code></a> better errors for invalid js decorator syntax</li> <li><a href="300eeb7112"><code>300eeb7</code></a> ts: allow non-null assertions in js decorators</li> <li><a href="4d997d9485"><code>4d997d9</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3698">#3698</a>: yarn pnp edge case with <code>tsconfig.json</code></li> <li><a href="cf42954760"><code>cf42954</code></a> resolver: improve some debug logging</li> <li><a href="b0765ae132"><code>b0765ae</code></a> fix some lints</li> <li><a href="dfa6206919"><code>dfa6206</code></a> fix some comments (closes <a href="https://redirect.github.com/evanw/esbuild/issues/3683">#3683</a>)</li> <li><a href="ae5cc17516"><code>ae5cc17</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3684">#3684</a>: <code>abstract</code> experimental decorators</li> <li><a href="c809af050a"><code>c809af0</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/2388">#2388</a>: allow consuming types without dom types (<a href="https://redirect.github.com/evanw/esbuild/issues/3679">#3679</a>)</li> <li>Additional commits viewable in <a href="https://github.com/evanw/esbuild/compare/v0.20.1...v0.20.2">compare view</a></li> </ul> </details> <br /> Updates `yaml` from 2.4.0 to 2.4.1 <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.4.1</h2> <ul> <li>cst: Do not drop trailing newline after line comment in block-map if followed by unindented block-seq value (<a href="https://redirect.github.com/eemeli/yaml/issues/525">#525</a>)</li> <li>Stringify flow collection comments in parent (<a href="https://redirect.github.com/eemeli/yaml/issues/528">#528</a>)</li> <li>Do not skip folding lines after the first in indented block scalars (<a href="https://redirect.github.com/eemeli/yaml/issues/529">#529</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="4aa56d337d"><code>4aa56d3</code></a> 2.4.1</li> <li><a href="e651ce1457"><code>e651ce1</code></a> chore: Refresh lockfile</li> <li><a href="1775f1341f"><code>1775f13</code></a> test: Drop unused import to satisfy TS</li> <li><a href="40903db981"><code>40903db</code></a> fix(cst): Do not drop trailing newline after line comment in block-map if fol...</li> <li><a href="46a816ecc1"><code>46a816e</code></a> fix: Do not skip folding lines after the first in indented block scalars (fix...</li> <li><a href="750adbe05d"><code>750adbe</code></a> fix: Stringify flow collection comments in parent (fixes <a href="https://redirect.github.com/eemeli/yaml/issues/528">#528</a>)</li> <li><a href="e07998c607"><code>e07998c</code></a> ci: Move update action to yaml-playground, where it has write access</li> <li><a href="5ba73d1706"><code>5ba73d1</code></a> ci: Update yaml-playground build & BrowserStack tests (<a href="https://redirect.github.com/eemeli/yaml/issues/524">#524</a>)</li> <li>See full diff in <a href="https://github.com/eemeli/yaml/compare/v2.4.0...v2.4.1">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)
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 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.
owner
Optional: The owner of the GitHub App installation. If empty, defaults to the current repository owner.
repositories
Optional: Comma-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.