Bumps the development-dependencies group with 4 updates: [ava](https://github.com/avajs/ava), [dotenv](https://github.com/motdotla/dotenv), [esbuild](https://github.com/evanw/esbuild) and [yaml](https://github.com/eemeli/yaml). Updates `ava` from 6.1.1 to 6.1.2 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/avajs/ava/releases">ava's releases</a>.</em></p> <blockquote> <h2>v6.1.2</h2> <h2>What's Changed</h2> <ul> <li>Fix throws assertions rejecting falsy values when <code>any: true</code> by <a href="https://github.com/gibson042"><code>@gibson042</code></a> in <a href="https://redirect.github.com/avajs/ava/pull/3313">avajs/ava#3313</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/avajs/ava/compare/v6.1.1...v6.1.2">https://github.com/avajs/ava/compare/v6.1.1...v6.1.2</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="5d48c953e5"><code>5d48c95</code></a> 6.1.2</li> <li><a href="be5000aac1"><code>be5000a</code></a> Fix throws assertions rejecting falsy values when any: true</li> <li><a href="1d62caf585"><code>1d62caf</code></a> Upgrade xo to v0.57.0</li> <li>See full diff in <a href="https://github.com/avajs/ava/compare/v6.1.1...v6.1.2">compare view</a></li> </ul> </details> <br /> Updates `dotenv` from 16.4.1 to 16.4.5 <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md">dotenv's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/motdotla/dotenv/compare/v16.4.4...v16.4.5">16.4.5</a> (2024-02-19)</h2> <h3>Changed</h3> <ul> <li>🐞 fix recent regression when using <code>path</code> option. return to historical behavior: do not attempt to auto find <code>.env</code> if <code>path</code> set. (regression was introduced in <code>16.4.3</code>) <a href="https://redirect.github.com/motdotla/dotenv/pull/814">#814</a></li> </ul> <h2><a href="https://github.com/motdotla/dotenv/compare/v16.4.3...v16.4.4">16.4.4</a> (2024-02-13)</h2> <h3>Changed</h3> <ul> <li>🐞 Replaced chaining operator <code>?.</code> with old school <code>&&</code> (fixing node 12 failures) <a href="https://redirect.github.com/motdotla/dotenv/pull/812">#812</a></li> </ul> <h2><a href="https://github.com/motdotla/dotenv/compare/v16.4.2...v16.4.3">16.4.3</a> (2024-02-12)</h2> <h3>Changed</h3> <ul> <li>Fixed processing of multiple files in <code>options.path</code> <a href="https://redirect.github.com/motdotla/dotenv/pull/805">#805</a></li> </ul> <h2><a href="https://github.com/motdotla/dotenv/compare/v16.4.1...v16.4.2">16.4.2</a> (2024-02-10)</h2> <h3>Changed</h3> <ul> <li>Changed funding link in package.json to <a href="https://dotenvx.com"><code>dotenvx.com</code></a></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="9f3e83352e"><code>9f3e833</code></a> 16.4.5</li> <li><a href="69241772b6"><code>6924177</code></a> Merge pull request <a href="https://redirect.github.com/motdotla/dotenv/issues/814">#814</a> from motdotla/dont-check-existance</li> <li><a href="353342048c"><code>3533420</code></a> changelog 🪵</li> <li><a href="249e5a64f6"><code>249e5a6</code></a> adjust logic to support tests</li> <li><a href="87fd887e31"><code>87fd887</code></a> do not check if exists</li> <li><a href="1146910932"><code>1146910</code></a> rename .env-multiline to .env.multiline</li> <li><a href="d03e39794a"><code>d03e397</code></a> 16.4.4</li> <li><a href="3275a0a940"><code>3275a0a</code></a> changelog 🪵</li> <li><a href="f40a8c3e35"><code>f40a8c3</code></a> Merge pull request <a href="https://redirect.github.com/motdotla/dotenv/issues/812">#812</a> from motdotla/patch-12</li> <li><a href="1dc22d312f"><code>1dc22d3</code></a> replace 14 chaining operator</li> <li>Additional commits viewable in <a href="https://github.com/motdotla/dotenv/compare/v16.4.1...v16.4.5">compare view</a></li> </ul> </details> <br /> Updates `esbuild` from 0.20.0 to 0.20.1 <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.1</h2> <ul> <li> <p>Fix a bug with the CSS nesting transform (<a href="https://redirect.github.com/evanw/esbuild/issues/3648">#3648</a>)</p> <p>This release fixes a bug with the CSS nesting transform for older browsers where the generated CSS could be incorrect if a selector list contained a pseudo element followed by another selector. The bug was caused by incorrectly mutating the parent rule's selector list when filtering out pseudo elements for the child rules:</p> <pre lang="css"><code>/* Original code */ .foo { &:after, & .bar { color: red; } } <p>/* Old output (with --supported:nesting=false) */ .foo .bar, .foo .bar { color: red; }</p> <p>/* New output (with --supported:nesting=false) */ .foo:after, .foo .bar { color: red; } </code></pre></p> </li> <li> <p>Constant folding for JavaScript inequality operators (<a href="https://redirect.github.com/evanw/esbuild/issues/3645">#3645</a>)</p> <p>This release introduces constant folding for the <code>< > <= >=</code> operators. The minifier will now replace these operators with <code>true</code> or <code>false</code> when both sides are compile-time numeric or string constants:</p> <pre lang="js"><code>// Original code console.log(1 < 2, '🍕' > '🧀') <p>// Old output (with --minify) console.log(1<2,"🍕">"🧀");</p> <p>// New output (with --minify) console.log(!0,!1); </code></pre></p> </li> <li> <p>Better handling of <code>__proto__</code> edge cases (<a href="https://redirect.github.com/evanw/esbuild/pull/3651">#3651</a>)</p> <p>JavaScript object literal syntax contains a special case where a non-computed property with a key of <code>__proto__</code> sets the prototype of the object. This does not apply to computed properties or to properties that use the shorthand property syntax introduced in ES6. Previously esbuild didn't correctly preserve the "sets the prototype" status of properties inside an object literal, meaning a property that sets the prototype could accidentally be transformed into one that doesn't and vice versa. This has now been fixed:</p> <pre lang="js"><code>// Original code function foo(__proto__) { return { __proto__: __proto__ } // Note: sets the prototype </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.20.1</h2> <ul> <li> <p>Fix a bug with the CSS nesting transform (<a href="https://redirect.github.com/evanw/esbuild/issues/3648">#3648</a>)</p> <p>This release fixes a bug with the CSS nesting transform for older browsers where the generated CSS could be incorrect if a selector list contained a pseudo element followed by another selector. The bug was caused by incorrectly mutating the parent rule's selector list when filtering out pseudo elements for the child rules:</p> <pre lang="css"><code>/* Original code */ .foo { &:after, & .bar { color: red; } } <p>/* Old output (with --supported:nesting=false) */ .foo .bar, .foo .bar { color: red; }</p> <p>/* New output (with --supported:nesting=false) */ .foo:after, .foo .bar { color: red; } </code></pre></p> </li> <li> <p>Constant folding for JavaScript inequality operators (<a href="https://redirect.github.com/evanw/esbuild/issues/3645">#3645</a>)</p> <p>This release introduces constant folding for the <code>< > <= >=</code> operators. The minifier will now replace these operators with <code>true</code> or <code>false</code> when both sides are compile-time numeric or string constants:</p> <pre lang="js"><code>// Original code console.log(1 < 2, '🍕' > '🧀') <p>// Old output (with --minify) console.log(1<2,"🍕">"🧀");</p> <p>// New output (with --minify) console.log(!0,!1); </code></pre></p> </li> <li> <p>Better handling of <code>__proto__</code> edge cases (<a href="https://redirect.github.com/evanw/esbuild/pull/3651">#3651</a>)</p> <p>JavaScript object literal syntax contains a special case where a non-computed property with a key of <code>__proto__</code> sets the prototype of the object. This does not apply to computed properties or to properties that use the shorthand property syntax introduced in ES6. Previously esbuild didn't correctly preserve the "sets the prototype" status of properties inside an object literal, meaning a property that sets the prototype could accidentally be transformed into one that doesn't and vice versa. This has now been fixed:</p> <pre lang="js"><code>// Original code function foo(__proto__) { </code></pre> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="9f9e4f85e6"><code>9f9e4f8</code></a> publish 0.20.1 to npm</li> <li><a href="ac365374f9"><code>ac36537</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3651">#3651</a>: handle <code>__proto__</code> edge cases better</li> <li><a href="555db48d3d"><code>555db48</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3645">#3645</a>: constant folding for <code>\< > \<= >=</code></li> <li><a href="5650831e1e"><code>5650831</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3650">#3650</a>: add a wrapper for float64 math</li> <li><a href="d086889869"><code>d086889</code></a> fix some lints</li> <li><a href="ad3d8c63ea"><code>ad3d8c6</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3648">#3648</a>: copy selectors before checking children</li> <li><a href="a08f30db4a"><code>a08f30d</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/3634">#3634</a>: crash if resolving with bad source dir</li> <li>See full diff in <a href="https://github.com/evanw/esbuild/compare/v0.20.0...v0.20.1">compare view</a></li> </ul> </details> <br /> Updates `yaml` from 2.3.4 to 2.4.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.4.0</h2> <ul> <li>Add a command-line tool (<a href="https://redirect.github.com/eemeli/yaml/issues/523">#523</a>)</li> <li>Use the <code>lineWidth</code> option for line breaking in flow collections (<a href="https://redirect.github.com/eemeli/yaml/issues/522">#522</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="8d8cfb70a1"><code>8d8cfb7</code></a> 2.4.0</li> <li><a href="e6a5e28052"><code>e6a5e28</code></a> feat: Add CLI tool (<a href="https://redirect.github.com/eemeli/yaml/issues/523">#523</a>)</li> <li><a href="959f1cf937"><code>959f1cf</code></a> docs: Add a predocs script creating symlinks for docs generator</li> <li><a href="74a86e2670"><code>74a86e2</code></a> docs: Add yaml-types mention</li> <li><a href="e80a4c5f2f"><code>e80a4c5</code></a> chore: Update json-test-suite</li> <li><a href="b5fa4cbe61"><code>b5fa4cb</code></a> chore: Update Babel plugins</li> <li><a href="9fc76faedd"><code>9fc76fa</code></a> chore: Update <code>@types/node</code> to v20</li> <li><a href="495cfebf3d"><code>495cfeb</code></a> chore: Update rollup to v4</li> <li><a href="28b3ba5bf2"><code>28b3ba5</code></a> chore: Update typescript-eslint to v7</li> <li><a href="e4f963ae15"><code>e4f963a</code></a> style: Apply updated Prettier rules</li> <li>Additional commits viewable in <a href="https://github.com/eemeli/yaml/compare/v2.3.4...v2.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)
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 }}
github-api-url: "https://github.acme-inc.com/api/v3"
- 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: GitHub App installation owner. 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.
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.