Bumps the development-dependencies group with 3 updates in the / directory: [esbuild](https://github.com/evanw/esbuild), [undici](https://github.com/nodejs/undici) and [yaml](https://github.com/eemeli/yaml). Updates `esbuild` from 0.28.1 to 0.28.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.28.2</h2> <ul> <li> <p>Fix tree shaking bug due to TypeScript import alias (<a href="https://redirect.github.com/evanw/esbuild/issues/4507">#4507</a>)</p> <p>This release fixes a bug that could cause esbuild to incorrectly tree-shake imports that are used in a TypeScript type alias under certain circumstances. Affected code uses a TypeScript-specific <code>import</code> assignment and looks something like this:</p> <pre lang="ts"><code>import Base from './dep.js'; import Alias = Base.SomeType; </code></pre> </li> <li> <p>Fix CSS minification bug involving <code>&</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/4497">#4497</a>)</p> <p>This release fixes a bug where esbuild's CSS minifier incorrectly removed a <code>&</code> when it was unsafe to do so. Here is an example:</p> <pre lang="css"><code>/* Original code */ .a .b { & .b:not(& .c) { color: red; } } <p>/* Old output (with --minify) */<br /> .a .b{.b:not(& .c){color:red}}</p> <p>/* New output (with --minify) */<br /> .a .b{& .b:not(& .c){color:red}}<br /> </code></pre></p> <p>This should match <code><span class="a"><span class="b"><span class="b">yes</span></span></span></code> but not <code><span class="a"><span class="b">no</span></span></code>. The old output incorrectly matched both.</p> </li> <li> <p>Avoid overwriting input files without <code>--allow-overwrite</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/4484">#4484</a>)</p> <p>For example: <code>esbuild input.js --outfile=input.js</code> tells esbuild to overwrite <code>input.js</code> with the output of running esbuild on it. This was supposed to already be prevented by default, but it accidentally regressed in version 0.17.0 and apparently didn't have any test coverage. The error message was being printed but the input file was still being overwritten. Oops.</p> <p>This release puts the original behavior back. With this release, esbuild should now actually avoid overwriting input files unless <code>--allow-overwrite</code> is explicitly present. This is done by not writing out any files when a build error is encountered.</p> </li> <li> <p>Fix incorrect code generated when using top-level await (<a href="https://redirect.github.com/evanw/esbuild/issues/4498">#4498</a>)</p> <p>Previously esbuild could generate code containing a syntax error in complex scenarios involving top-level await used in a dependency cycle. The problem was a missing <code>async</code> on one or more module wrapper closures. With this release, esbuild now uses a fixed-point iteration algorithm to correctly annotate all dependencies in the cycle as needing an <code>async</code> module wrapper.</p> </li> <li> <p>Fix a minification bug with lowered logical assignment operators (<a href="https://redirect.github.com/evanw/esbuild/issues/4508">#4508</a>)</p> <p>This release fixes a bug that could cause esbuild to generate incorrect code for logical assignment operators when lowering them to an older target environment. Specifically the lowering process requires duplicating the left-hand side, but esbuild incorrectly failed to count the duplicate as a new usage when the left-hand side is an identifier. That then caused the minifier to believe that the left-hand side was only used once and could attempt to incorrectly inline an initializer into the first usage. This bug has now been fixed:</p> <pre lang="js"><code>// Original code function foo() { let x bar(x ||= {}) </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.28.2</h2> <ul> <li> <p>Fix tree shaking bug due to TypeScript import alias (<a href="https://redirect.github.com/evanw/esbuild/issues/4507">#4507</a>)</p> <p>This release fixes a bug that could cause esbuild to incorrectly tree-shake imports that are used in a TypeScript type alias under certain circumstances. Affected code uses a TypeScript-specific <code>import</code> assignment and looks something like this:</p> <pre lang="ts"><code>import Base from './dep.js'; import Alias = Base.SomeType; </code></pre> </li> <li> <p>Fix CSS minification bug involving <code>&</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/4497">#4497</a>)</p> <p>This release fixes a bug where esbuild's CSS minifier incorrectly removed a <code>&</code> when it was unsafe to do so. Here is an example:</p> <pre lang="css"><code>/* Original code */ .a .b { & .b:not(& .c) { color: red; } } <p>/* Old output (with --minify) */<br /> .a .b{.b:not(& .c){color:red}}</p> <p>/* New output (with --minify) */<br /> .a .b{& .b:not(& .c){color:red}}<br /> </code></pre></p> <p>This should match <code><span class="a"><span class="b"><span class="b">yes</span></span></span></code> but not <code><span class="a"><span class="b">no</span></span></code>. The old output incorrectly matched both.</p> </li> <li> <p>Avoid overwriting input files without <code>--allow-overwrite</code> (<a href="https://redirect.github.com/evanw/esbuild/issues/4484">#4484</a>)</p> <p>For example: <code>esbuild input.js --outfile=input.js</code> tells esbuild to overwrite <code>input.js</code> with the output of running esbuild on it. This was supposed to already be prevented by default, but it accidentally regressed in version 0.17.0 and apparently didn't have any test coverage. The error message was being printed but the input file was still being overwritten. Oops.</p> <p>This release puts the original behavior back. With this release, esbuild should now actually avoid overwriting input files unless <code>--allow-overwrite</code> is explicitly present. This is done by not writing out any files when a build error is encountered.</p> </li> <li> <p>Fix incorrect code generated when using top-level await (<a href="https://redirect.github.com/evanw/esbuild/issues/4498">#4498</a>)</p> <p>Previously esbuild could generate code containing a syntax error in complex scenarios involving top-level await used in a dependency cycle. The problem was a missing <code>async</code> on one or more module wrapper closures. With this release, esbuild now uses a fixed-point iteration algorithm to correctly annotate all dependencies in the cycle as needing an <code>async</code> module wrapper.</p> </li> <li> <p>Fix a minification bug with lowered logical assignment operators (<a href="https://redirect.github.com/evanw/esbuild/issues/4508">#4508</a>)</p> <p>This release fixes a bug that could cause esbuild to generate incorrect code for logical assignment operators when lowering them to an older target environment. Specifically the lowering process requires duplicating the left-hand side, but esbuild incorrectly failed to count the duplicate as a new usage when the left-hand side is an identifier. That then caused the minifier to believe that the left-hand side was only used once and could attempt to incorrectly inline an initializer into the first usage. This bug has now been fixed:</p> <pre lang="js"><code>// Original code function foo() { let x </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/609683d892977362a0f99026cb74b96263d728a9"><code>609683d</code></a> publish 0.28.2 to npm</li> <li><a href="https://github.com/evanw/esbuild/commit/11b1fe48df6859393d9469f323b5ebd17baaf989"><code>11b1fe4</code></a> add to release notes</li> <li><a href="https://github.com/evanw/esbuild/commit/ab50d91559a27e54cd0a27a403389130ea10d97d"><code>ab50d91</code></a> css: fix green/blue channel swap in oklch gamut mapping (<a href="https://redirect.github.com/evanw/esbuild/issues/4488">#4488</a>)</li> <li><a href="https://github.com/evanw/esbuild/commit/04627b6cf99b4a7491bebb0268173a7c77a85030"><code>04627b6</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/4498">#4498</a>: <code>async</code> TLA checks need a worklist</li> <li><a href="https://github.com/evanw/esbuild/commit/5c15177a308c7224604058a769c4abf0a66b0a36"><code>5c15177</code></a> disable <code>gopls</code> in the <code>go</code> folder</li> <li><a href="https://github.com/evanw/esbuild/commit/fc2ee9babc5a2e8ea7ec7c10dd5850b71f7cec7e"><code>fc2ee9b</code></a> css: adjust parser to allow <code>--foo: {...}</code></li> <li><a href="https://github.com/evanw/esbuild/commit/209db54371e62ad1c50e12e56bb93c74c53b0408"><code>209db54</code></a> release notes for css nesting bugfix</li> <li><a href="https://github.com/evanw/esbuild/commit/c625d31bf08a0647ec724bf76c7115f7aec55971"><code>c625d31</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/4497">#4497</a>: preserve nested ampersands during minification (<a href="https://redirect.github.com/evanw/esbuild/issues/4500">#4500</a>)</li> <li><a href="https://github.com/evanw/esbuild/commit/34474e278528a60f58c959c0f422d2bfa6f6886d"><code>34474e2</code></a> better isolation of current part in js parser</li> <li><a href="https://github.com/evanw/esbuild/commit/07f6e8c50677e0b41e5ed726c08b0ea200b14e5b"><code>07f6e8c</code></a> fix <a href="https://redirect.github.com/evanw/esbuild/issues/4507">#4507</a>: <code>import</code> assignment tree-shaking bug</li> <li>Additional commits viewable in <a href="https://github.com/evanw/esbuild/compare/v0.28.1...v0.28.2">compare view</a></li> </ul> </details> <br /> Updates `undici` from 8.5.0 to 8.11.2 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/nodejs/undici/releases">undici's releases</a>.</em></p> <blockquote> <h2>v8.11.2</h2> <h2>What's Changed</h2> <ul> <li>fix: close rejected HTTP/2 WebSocket handshake streams by <a href="https://github.com/mcollina"><code>@mcollina</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5873">nodejs/undici#5873</a></li> <li>fix: avoid reconnecting aborted requests by <a href="https://github.com/Junaid-PK"><code>@Junaid-PK</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5846">nodejs/undici#5846</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/Junaid-PK"><code>@Junaid-PK</code></a> made their first contribution in <a href="https://redirect.github.com/nodejs/undici/pull/5846">nodejs/undici#5846</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/nodejs/undici/compare/v8.11.1...v8.11.2">https://github.com/nodejs/undici/compare/v8.11.1...v8.11.2</a></p> <h2>v8.11.1</h2> <h2>What's Changed</h2> <ul> <li>deslopify websocket test by <a href="https://github.com/KhafraDev"><code>@KhafraDev</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5851">nodejs/undici#5851</a></li> <li>Revert "fix: preserve HTTP/2 for legacy fetch consumers" by <a href="https://github.com/mcollina"><code>@mcollina</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5860">nodejs/undici#5860</a></li> <li>fix websocketstream bugs by <a href="https://github.com/KhafraDev"><code>@KhafraDev</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5863">nodejs/undici#5863</a></li> <li>fix hang on 3xx response with large body by <a href="https://github.com/KhafraDev"><code>@KhafraDev</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5850">nodejs/undici#5850</a></li> <li>docs: warn about buffering response bodies by <a href="https://github.com/mcollina"><code>@mcollina</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5872">nodejs/undici#5872</a></li> <li>test: cover native fetch gzip decoding through the legacy bridge by <a href="https://github.com/mcollina"><code>@mcollina</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5874">nodejs/undici#5874</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/nodejs/undici/compare/v8.11.0...v8.11.1">https://github.com/nodejs/undici/compare/v8.11.0...v8.11.1</a></p> <h2>v8.11.0</h2> <h2>What's Changed</h2> <ul> <li>fix: complete upgrade diagnostics lifecycle by <a href="https://github.com/BridgeAR"><code>@BridgeAR</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5761">nodejs/undici#5761</a></li> <li>build(deps): bump step-security/harden-runner from 2.19.4 to 2.21.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nodejs/undici/pull/5753">nodejs/undici#5753</a></li> <li>fix(decompress): join a repeated content-encoding header by <a href="https://github.com/luantaraschi"><code>@luantaraschi</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5664">nodejs/undici#5664</a></li> <li>fix(cookies): keep a cookie named <strong>proto</strong> in getCookies by <a href="https://github.com/luantaraschi"><code>@luantaraschi</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5663">nodejs/undici#5663</a></li> <li>build(deps-dev): bump jest from 30.5.0 to 30.5.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nodejs/undici/pull/5784">nodejs/undici#5784</a></li> <li>build(deps): bump got from 15.1.0 to 16.0.0 in /benchmarks by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nodejs/undici/pull/5785">nodejs/undici#5785</a></li> <li>fix: selectively re-enable SIMD for ppc64 by <a href="https://github.com/richardlau"><code>@richardlau</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5776">nodejs/undici#5776</a></li> <li>use private fields for brand checks by <a href="https://github.com/KhafraDev"><code>@KhafraDev</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5792">nodejs/undici#5792</a></li> <li>fix(h2): do not unref a session with open streams by <a href="https://github.com/kjsik11"><code>@kjsik11</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5782">nodejs/undici#5782</a></li> <li>fix(h2): avoid pool fan-out during ALPN negotiation by <a href="https://github.com/mcollina"><code>@mcollina</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5799">nodejs/undici#5799</a></li> <li>fix issue <a href="https://redirect.github.com/nodejs/undici/issues/5715">#5715</a> by <a href="https://github.com/KhafraDev"><code>@KhafraDev</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5805">nodejs/undici#5805</a></li> <li>ci: extend macOS Node.js workflow timeout by <a href="https://github.com/mcollina"><code>@mcollina</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5775">nodejs/undici#5775</a></li> <li>fix(env-http-proxy-agent): NO_PROXY wildcard semantics by <a href="https://github.com/mcollina"><code>@mcollina</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5777">nodejs/undici#5777</a></li> <li>fix(h2): do not replay a request whose response already started after GOAWAY by <a href="https://github.com/kjsik11"><code>@kjsik11</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5788">nodejs/undici#5788</a></li> <li>test: skip HTTP/2 churn test on Node.js 25 on all platforms by <a href="https://github.com/kjsik11"><code>@kjsik11</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5790">nodejs/undici#5790</a></li> <li>fix(proxy-agent): preserve repeated iterable headers by <a href="https://github.com/GiHoon1123"><code>@GiHoon1123</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5779">nodejs/undici#5779</a></li> <li>docs(errors): document ProxyConnectionError (UND_ERR_PRX_CONN) by <a href="https://github.com/kilisamemarisaaa"><code>@kilisamemarisaaa</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5781">nodejs/undici#5781</a></li> <li>dataurl parsing improvements + update WPT by <a href="https://github.com/KhafraDev"><code>@KhafraDev</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5812">nodejs/undici#5812</a></li> <li>fix(decompress): treat inherited Object.prototype names as unsupported encodings by <a href="https://github.com/NgoQuocViet2001"><code>@NgoQuocViet2001</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5807">nodejs/undici#5807</a></li> <li>test(h2): stabilize http2-connection by <a href="https://github.com/ViniciusDev26"><code>@ViniciusDev26</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5801">nodejs/undici#5801</a></li> <li>fix: preserve HTTP/2 for non-upgrade legacy requests by <a href="https://github.com/mcollina"><code>@mcollina</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5811">nodejs/undici#5811</a></li> <li>fix: skip drain dispatch for clientTtl-evicted clients in PoolBase by <a href="https://github.com/vwong"><code>@vwong</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5677">nodejs/undici#5677</a></li> <li>chore: update tests blocking release by <a href="https://github.com/vwong"><code>@vwong</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5828">nodejs/undici#5828</a></li> <li>build(deps): bump uWebSockets.js from v20.68.0 to v20.70.0 in /benchmarks by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/nodejs/undici/pull/5824">nodejs/undici#5824</a></li> <li>fix(deduplicate): settle requests when composed with retry by <a href="https://github.com/mcollina"><code>@mcollina</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5817">nodejs/undici#5817</a></li> <li>fix(cache): do not report aborted on successful cache hits by <a href="https://github.com/Yahiro025"><code>@Yahiro025</code></a> in <a href="https://redirect.github.com/nodejs/undici/pull/5819">nodejs/undici#5819</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/nodejs/undici/commit/7e016ad7e5bd6540170069a9a28b1e633b29664f"><code>7e016ad</code></a> Bumped v8.11.2 (<a href="https://redirect.github.com/nodejs/undici/issues/5886">#5886</a>)</li> <li><a href="https://github.com/nodejs/undici/commit/fcdd5a615ab49beda87aafe14ad30106cfe3b0d5"><code>fcdd5a6</code></a> fix: skip reconnecting for aborted requests (<a href="https://redirect.github.com/nodejs/undici/issues/5846">#5846</a>)</li> <li><a href="https://github.com/nodejs/undici/commit/dd28c5c55f4a25f7c441fd4365b1191f96c3b8bf"><code>dd28c5c</code></a> fix: close rejected HTTP/2 WebSocket handshake streams (<a href="https://redirect.github.com/nodejs/undici/issues/5873">#5873</a>)</li> <li><a href="https://github.com/nodejs/undici/commit/5e0a2f8e02be8f1155feab2c52f55731d3bb84a4"><code>5e0a2f8</code></a> Bumped v8.11.1 (<a href="https://redirect.github.com/nodejs/undici/issues/5871">#5871</a>)</li> <li><a href="https://github.com/nodejs/undici/commit/2b728989ac5b9d247eca2094bb264ced76f7cef6"><code>2b72898</code></a> test: cover native fetch gzip decoding through the legacy bridge (<a href="https://redirect.github.com/nodejs/undici/issues/5874">#5874</a>)</li> <li><a href="https://github.com/nodejs/undici/commit/636bf515c0c8497dd0ca68917e4e38577c27669e"><code>636bf51</code></a> docs: warn about buffering response bodies (<a href="https://redirect.github.com/nodejs/undici/issues/5872">#5872</a>)</li> <li><a href="https://github.com/nodejs/undici/commit/8145595e221779980d91ff611f14e5a984661388"><code>8145595</code></a> fix hang on 3xx response with large body (<a href="https://redirect.github.com/nodejs/undici/issues/5850">#5850</a>)</li> <li><a href="https://github.com/nodejs/undici/commit/f3cbe486706da6163b4ca226022e74df73168dd5"><code>f3cbe48</code></a> fix websocketstream bugs (<a href="https://redirect.github.com/nodejs/undici/issues/5863">#5863</a>)</li> <li><a href="https://github.com/nodejs/undici/commit/1d4ea0a883bf33275d00c4db55377892180b2747"><code>1d4ea0a</code></a> Revert "fix: preserve HTTP/2 for legacy fetch consumers" (<a href="https://redirect.github.com/nodejs/undici/issues/5860">#5860</a>)</li> <li><a href="https://github.com/nodejs/undici/commit/77d7b3f8dd2d8114b686e32d8d28bd3dde06bc33"><code>77d7b3f</code></a> deslopify websocket test (<a href="https://redirect.github.com/nodejs/undici/issues/5851">#5851</a>)</li> <li>Additional commits viewable in <a href="https://github.com/nodejs/undici/compare/v8.5.0...v8.11.2">compare view</a></li> </ul> </details> <br /> Updates `yaml` from 2.9.0 to 2.9.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.9.1</h2> <ul> <li>Limit recursive merge aliases (<a href="https://redirect.github.com/eemeli/yaml/issues/685">#685</a>, <a href="https://redirect.github.com/eemeli/yaml/issues/713">#713</a>)</li> <li>Simplify line unfolding during quoted string parsing (<a href="https://redirect.github.com/eemeli/yaml/issues/714">#714</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/eemeli/yaml/commit/1440ecd3d1bff41e4ac399f8f6839e810328bd16"><code>1440ecd</code></a> 2.9.1</li> <li><a href="https://github.com/eemeli/yaml/commit/c699bc575b46e1dd3c05f1ffcf3f20f14085f8d8"><code>c699bc5</code></a> fix: Simplify line unfolding during quoted string parsing (<a href="https://redirect.github.com/eemeli/yaml/issues/714">#714</a>)</li> <li><a href="https://github.com/eemeli/yaml/commit/d11ce77c1adf022e9637f4d27b90fe9c96fe9743"><code>d11ce77</code></a> fix: Limit recursive merge aliases (<a href="https://redirect.github.com/eemeli/yaml/issues/713">#713</a>)</li> <li><a href="https://github.com/eemeli/yaml/commit/c5f49f4c616ea49239f010d5c9d8023e9667438a"><code>c5f49f4</code></a> chore: Update docs-slate</li> <li>See full diff in <a href="https://github.com/eemeli/yaml/compare/v2.9.0...v2.9.1">compare view</a></li> </ul> </details> <br /> 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 Client ID in your repository variables (example:
APP_CLIENT_ID). - Store the App's private key in your repository secrets (example:
APP_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@v3
id: app-token
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_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@v3
id: app-token
with:
# required
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v6
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@v6
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@v3
id: app-token
with:
# required
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_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@v3
id: app-token
with:
# required
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-contents: write
- 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'
gh auth setup-git
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
# Git commands like commit and push 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@v3
id: app-token
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: peter-evans/create-or-update-comment@v4
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@v3
id: app-token
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
repo1
repo2
- uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
body: "Hello, World!"
You can include the current repository in the list with ${{ github.repository }}:
repositories: ${{ github.repository }},repo2
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@v3
id: app-token
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: another-owner
- uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
body: "Hello, World!"
Create a token for an enterprise installation
on: [workflow_dispatch]
jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v3
id: app-token
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
enterprise: my-enterprise-slug
- name: Call enterprise management REST API with gh
run: |
gh api /enterprises/my-enterprise-slug/apps/installable_organizations
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
Create a token with specific permissions
Note
Selected permissions must be granted to the specified app installation. Setting a permission that the installation does not have will result in an error.
on: [issues]
jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v3
id: app-token
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
permission-issues: write
- uses: peter-evans/create-or-update-comment@v4
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@v3
id: app-token
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_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@v3
with:
client-id: ${{ vars.GHES_APP_CLIENT_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 }}
Proxy support
This action relies on Node.js native proxy support.
If you set HTTP_PROXY or HTTPS_PROXY, also set NODE_USE_ENV_PROXY: "1" on the action step so Node.js honors those variables. If you need proxy bypass rules, set NO_PROXY alongside them.
- uses: actions/create-github-app-token@v3
id: app-token
env:
HTTPS_PROXY: http://proxy.example.com:8080
NO_PROXY: github.example.com
NODE_USE_ENV_PROXY: "1"
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
Inputs
client-id or app-id
Required: GitHub App Client ID.
Note
The legacy
app-idinput is also accepted, butclient-idis recommended.
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.APP_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@v3
with:
client-id: ${{ vars.APP_CLIENT_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.Repository entries may include an owner, for example
owner/repo1. The owner portion must match theownerinput, or the current repository owner ifowneris unset.
enterprise
Optional: The slug of the enterprise account to generate a token for an enterprise installation.
Note
The
enterpriseinput is mutually exclusive withownerandrepositories. Use it when the GitHub App is installed on an enterprise account. Enterprise installation tokens can call enterprise APIs, but do not grant organization or repository access.
permission-<permission name>
Optional: The permissions to grant to the token. By default, the token inherits all of the installation's permissions. We recommend to explicitly list the permissions that are required for a use case. This follows GitHub's own recommendation to control permissions of GITHUB_TOKEN in workflows. The documentation also lists all available permissions, just prefix the permission key with permission- (e.g., pull-requests → permission-pull-requests).
The reason we define one permision-<permission name> input per permission is to benefit from type intelligence and input validation built into GitHub's action runner.
skip-token-revoke
Optional: If true, 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.
The token target depends on the inputs: enterprise creates a token for an enterprise installation, owner without repositories creates a token for all repositories in the owner's installation, repositories scopes the token to those repositories, and no target inputs scopes the token to the current repository.
- 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 true, 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.