dependabot[bot] 2aec84ed45 build(deps-dev): bump the development-dependencies group with 3 updates (#139)
Bumps the development-dependencies group with 3 updates:
[ava](https://github.com/avajs/ava),
[esbuild](https://github.com/evanw/esbuild) and
[execa](https://github.com/sindresorhus/execa).

Updates `ava` from 6.1.2 to 6.1.3
<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.3</h2>
<h2>What's Changed</h2>
<ul>
<li>Include Node.js 22 in supported engines and test matrix by <a
href="https://github.com/lenovouser"><code>@​lenovouser</code></a> in <a
href="https://redirect.github.com/avajs/ava/pull/3328">avajs/ava#3328</a></li>
<li>Add VS Code debugging instructions for Yarn PnP projects by <a
href="https://github.com/bitjson"><code>@​bitjson</code></a> in <a
href="https://redirect.github.com/avajs/ava/pull/3317">avajs/ava#3317</a></li>
<li>Document <code>serial</code> configuration option by <a
href="https://github.com/turadg"><code>@​turadg</code></a> in <a
href="https://redirect.github.com/avajs/ava/pull/3321">avajs/ava#3321</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/bitjson"><code>@​bitjson</code></a> made
their first contribution in <a
href="https://redirect.github.com/avajs/ava/pull/3317">avajs/ava#3317</a></li>
<li><a href="https://github.com/turadg"><code>@​turadg</code></a> made
their first contribution in <a
href="https://redirect.github.com/avajs/ava/pull/3321">avajs/ava#3321</a></li>
<li><a
href="https://github.com/lenovouser"><code>@​lenovouser</code></a> made
their first contribution in <a
href="https://redirect.github.com/avajs/ava/pull/3328">avajs/ava#3328</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/avajs/ava/compare/v6.1.2...v6.1.3">https://github.com/avajs/ava/compare/v6.1.2...v6.1.3</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/avajs/ava/commit/f8bf00cd988b5e981b6c7d87523a1e0c5dc947c0"><code>f8bf00c</code></a>
6.1.3</li>
<li><a
href="https://github.com/avajs/ava/commit/002b3a0e936a2e8a7b91395c1fbfd128e2248966"><code>002b3a0</code></a>
Include Node.js 22 in supported engines and test matrix</li>
<li><a
href="https://github.com/avajs/ava/commit/ec1a8d2336e55011aaea966c2273bb86e4dafa88"><code>ec1a8d2</code></a>
Document <code>serial</code> configuration option</li>
<li><a
href="https://github.com/avajs/ava/commit/01ec2804ab9db0ab3ef11e3b5b0c5697d68f8bc5"><code>01ec280</code></a>
Add VS Code debugging instructions for Yarn PnP projects</li>
<li>See full diff in <a
href="https://github.com/avajs/ava/compare/v6.1.2...v6.1.3">compare
view</a></li>
</ul>
</details>
<br />

Updates `esbuild` from 0.20.2 to 0.21.4
<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.21.4</h2>
<ul>
<li>
<p>Update support for import assertions and import attributes in node
(<a
href="https://redirect.github.com/evanw/esbuild/issues/3778">#3778</a>)</p>
<p>Import assertions (the <code>assert</code> keyword) have been removed
from node starting in v22.0.0. So esbuild will now strip them and
generate a warning with <code>--target=node22</code> or above:</p>
<pre><code>▲ [WARNING] The &quot;assert&quot; keyword is not supported
in the configured target environment (&quot;node22&quot;)
[assert-to-with]
<pre><code>example.mjs:1:40:
1 │ import json from &amp;quot;esbuild/package.json&amp;quot; assert {
type: &amp;quot;json&amp;quot; }
    │                                         ~~~~~~
    ╵                                         with
</code></pre>
<p>Did you mean to use &quot;with&quot; instead of &quot;assert&quot;?
</code></pre></p>
<p>Import attributes (the <code>with</code> keyword) have been
backported to node 18 starting in v18.20.0. So esbuild will no longer
strip them with <code>--target=node18.N</code> if <code>N</code> is 20
or greater.</p>
</li>
<li>
<p>Fix <code>for await</code> transform when a label is present</p>
<p>This release fixes a bug where the <code>for await</code> transform,
which wraps the loop in a <code>try</code> statement, previously failed
to also move the loop's label into the <code>try</code> statement. This
bug only affects code that uses both of these features in combination.
Here's an example of some affected code:</p>
<pre lang="js"><code>// Original code
async function test() {
  outer: for await (const x of [Promise.resolve([0, 1])]) {
    for (const y of x) if (y) break outer
    throw 'fail'
  }
}
<p>// Old output (with --target=es6)
function test() {
return __async(this, null, function* () {
outer: try {
for (var iter = __forAwait([Promise.resolve([0, 1])]), more, temp,
error; more = !(temp = yield iter.next()).done; more = false) {
const x = temp.value;
for (const y of x) if (y) break outer;
throw &quot;fail&quot;;
}
} catch (temp) {
error = [temp];
} finally {
try {
more &amp;&amp; (temp = iter.return) &amp;&amp; (yield temp.call(iter));
} finally {
if (error)
throw error[0];
}
}
</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.21.4</h2>
<ul>
<li>
<p>Update support for import assertions and import attributes in node
(<a
href="https://redirect.github.com/evanw/esbuild/issues/3778">#3778</a>)</p>
<p>Import assertions (the <code>assert</code> keyword) have been removed
from node starting in v22.0.0. So esbuild will now strip them and
generate a warning with <code>--target=node22</code> or above:</p>
<pre><code>▲ [WARNING] The &quot;assert&quot; keyword is not supported
in the configured target environment (&quot;node22&quot;)
[assert-to-with]
<pre><code>example.mjs:1:40:
1 │ import json from &amp;quot;esbuild/package.json&amp;quot; assert {
type: &amp;quot;json&amp;quot; }
    │                                         ~~~~~~
    ╵                                         with
</code></pre>
<p>Did you mean to use &quot;with&quot; instead of &quot;assert&quot;?
</code></pre></p>
<p>Import attributes (the <code>with</code> keyword) have been
backported to node 18 starting in v18.20.0. So esbuild will no longer
strip them with <code>--target=node18.N</code> if <code>N</code> is 20
or greater.</p>
</li>
<li>
<p>Fix <code>for await</code> transform when a label is present</p>
<p>This release fixes a bug where the <code>for await</code> transform,
which wraps the loop in a <code>try</code> statement, previously failed
to also move the loop's label into the <code>try</code> statement. This
bug only affects code that uses both of these features in combination.
Here's an example of some affected code:</p>
<pre lang="js"><code>// Original code
async function test() {
  outer: for await (const x of [Promise.resolve([0, 1])]) {
    for (const y of x) if (y) break outer
    throw 'fail'
  }
}
<p>// Old output (with --target=es6)
function test() {
return __async(this, null, function* () {
outer: try {
for (var iter = __forAwait([Promise.resolve([0, 1])]), more, temp,
error; more = !(temp = yield iter.next()).done; more = false) {
const x = temp.value;
for (const y of x) if (y) break outer;
throw &quot;fail&quot;;
}
} catch (temp) {
error = [temp];
} finally {
try {
more &amp;&amp; (temp = iter.return) &amp;&amp; (yield temp.call(iter));
} finally {
if (error)
throw error[0];
}
</code></pre></p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/evanw/esbuild/commit/67cbf87a4909d87a902ca8c3b69ab5330defab0a"><code>67cbf87</code></a>
publish 0.21.4 to npm</li>
<li><a
href="https://github.com/evanw/esbuild/commit/4ad11c303e9fdbbd2dc6198f69abf9e18a8658e5"><code>4ad11c3</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3639">#3639</a>,
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3646">#3646</a>:
pass <code>with</code> to <code>onResolve</code></li>
<li><a
href="https://github.com/evanw/esbuild/commit/516ca317a40185e69265cb50a146130b2e6a7fe6"><code>516ca31</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3343">#3343</a>:
allow bundle-internal string aliases</li>
<li><a
href="https://github.com/evanw/esbuild/commit/9e2f304cb651d8dfe1a82a26c8d6e38d83046da2"><code>9e2f304</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3416">#3416</a>,
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3425">#3425</a>:
better enum constant folding</li>
<li><a
href="https://github.com/evanw/esbuild/commit/8f1faf7d4a9e5d26768e7b29dc6f5a983be98dbc"><code>8f1faf7</code></a>
implement late constant-folding for <code>&amp;&amp; || ??</code></li>
<li><a
href="https://github.com/evanw/esbuild/commit/7d50a50dccbbba7db0633e9f930249853d5cf241"><code>7d50a50</code></a>
implement late constant-folding of string enums</li>
<li><a
href="https://github.com/evanw/esbuild/commit/1b29ac7d0a85db78d9cb1b39d36f1e0d6284526d"><code>1b29ac7</code></a>
fold equality checks after cross-module inlining</li>
<li><a
href="https://github.com/evanw/esbuild/commit/d7a8bf32702fe5b4a91c2aecf66ae52117f901d8"><code>d7a8bf3</code></a>
formatting support for <code>@position-try</code> (for <a
href="https://redirect.github.com/evanw/esbuild/issues/3773">#3773</a>)</li>
<li><a
href="https://github.com/evanw/esbuild/commit/5069410dafd95f44b7d66732d8bfd0aef6321c3b"><code>5069410</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3778">#3778</a>:
import assertions/attributes for node</li>
<li><a
href="https://github.com/evanw/esbuild/commit/11d568c87468b4af3ea70b01944c1e7d1314ed97"><code>11d568c</code></a>
run <code>make update-compat-table</code></li>
<li>Additional commits viewable in <a
href="https://github.com/evanw/esbuild/compare/v0.20.2...v0.21.4">compare
view</a></li>
</ul>
</details>
<br />

Updates `execa` from 8.0.1 to 9.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/sindresorhus/execa/releases">execa's
releases</a>.</em></p>
<blockquote>
<h2>v9.1.0</h2>
<h2>Features (types)</h2>
<ul>
<li>Export <a
href="https://github.com/sindresorhus/execa/blob/HEAD/docs/typescript.md#available-types"><code>TemplateExpression</code></a>
type. (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1049">#1049</a>)</li>
</ul>
<h2>v9.0.2</h2>
<h2>Bug fixes (types)</h2>
<ul>
<li>Do not require using <code>--lib dom</code> for TypeScript users (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1043">#1043</a>,
<a
href="https://redirect.github.com/sindresorhus/execa/issues/1044">#1044</a>)</li>
<li>Fix type of the <code>reject</code> option (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1046">#1046</a>)</li>
</ul>
<h2>v9.0.1</h2>
<h2>Bug fixes (types)</h2>
<ul>
<li>Fix types not being importable (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1033">#1033</a>)
3bdab60</li>
<li>Fix complexity bug with types (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1037">#1037</a>)
6cc519b</li>
<li>Fix complexity bug with types (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1035">#1035</a>)
fee011d</li>
</ul>
<h2>v9.0.0</h2>
<p>This major release brings many important features including:</p>
<ul>
<li><a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#3a26">Split
the output</a> into lines, or <a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#3a26">progressively
iterate</a> over them.</li>
<li><a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#cbd6">Transform
or filter</a> the input/output using <a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#399a">simple
functions</a>.</li>
<li>Print the output <a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#693f">to
the terminal</a> while still retrieving it programmatically.</li>
<li>Redirect the input/output <a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#693f">from/to
a file</a>.</li>
<li><a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#ec17">Advanced
piping</a> between multiple subprocesses.</li>
<li>Improved <a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#2913">verbose
mode</a>, for debugging.</li>
<li>More <a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#40d7">detailed
errors</a>, including when <a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#668c">terminating
subprocesses</a>.</li>
<li>Enhanced <a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#725b">template
string syntax</a>.</li>
<li><a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#bcbf">Global/shared
options</a>.</li>
<li><a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#5731">Web
streams</a> and Transform streams support.</li>
<li><a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f#47b9">Convert
the subprocess</a> to a stream.</li>
<li><a
href="https://github.com/sindresorhus/execa/blob/HEAD/readme.md#documentation">New
documentation</a> with many examples.</li>
</ul>
<p>Please check the <a
href="https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f">release
post</a> for a high-level overview! For the full list of breaking
changes, features and bug fixes, please read below.</p>
<p>Thanks <a
href="https://github.com/younggglcy"><code>@​younggglcy</code></a>, <a
href="https://github.com/koshic"><code>@​koshic</code></a>, <a
href="https://github.com/am0o0"><code>@​am0o0</code></a> and <a
href="https://github.com/codesmith-emmy"><code>@​codesmith-emmy</code></a>
for your help!</p>
<hr />
<p>One of the maintainers <a
href="https://github.com/ehmicky"><code>@​ehmicky</code></a> is looking
for a remote full-time position. Specialized in Node.js back-ends and
CLIs, he led Netlify <a
href="https://www.netlify.com/platform/core/build/">Build</a>, <a
href="https://www.netlify.com/integrations/">Plugins</a> and
Configuration for 2.5 years. Feel free to contact him on <a
href="https://www.mickael-hebert.com">his website</a> or on <a
href="https://www.linkedin.com/in/mickaelhebert/">LinkedIn</a>!</p>
<hr />
<h2>Breaking changes (not types)</h2>
<ul>
<li>
<p>Dropped support for Node.js version <code>&lt;18.19.0</code> and
<code>20.0.0 - 20.4.0</code>. (834e3726)</p>
</li>
<li>
<p>When the <a
href="https://github.com/sindresorhus/execa/blob/HEAD/docs/api.md#optionsencoding"><code>encoding</code>
option</a> is <code>'buffer'</code>, the output (<a
href="https://github.com/sindresorhus/execa/blob/HEAD/docs/api.md#resultstdout"><code>result.stdout</code></a>,
<a
href="https://github.com/sindresorhus/execa/blob/HEAD/docs/api.md#resultstderr"><code>result.stderr</code></a>,
<a
href="https://github.com/sindresorhus/execa/blob/HEAD/docs/api.md#resultall"><code>result.all</code></a>)
is now an <a
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array"><code>Uint8Array</code></a>
instead of a <a
href="https://nodejs.org/api/buffer.html#class-buffer"><code>Buffer</code></a>.
For more information, see <a
href="https://sindresorhus.com/blog/goodbye-nodejs-buffer">this blog
post</a>. (by <a
href="https://github.com/younggglcy"><code>@​younggglcy</code></a>) (<a
href="https://redirect.github.com/sindresorhus/execa/issues/586">#586</a>)</p>
</li>
</ul>
<pre lang="js"><code>&lt;/tr&gt;&lt;/table&gt; 
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/sindresorhus/execa/commit/62d02af66940551bfb50699d7d02eed942453952"><code>62d02af</code></a>
9.1.0</li>
<li><a
href="https://github.com/sindresorhus/execa/commit/733d6ff6c2cae3a64ef003accf7c419a6235900f"><code>733d6ff</code></a>
Split CI jobs (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1052">#1052</a>)</li>
<li><a
href="https://github.com/sindresorhus/execa/commit/3b11ac87d9c6230710dc69e0bceadd45ae7e4d86"><code>3b11ac8</code></a>
Check types on TypeScript 5.1 + latest (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1051">#1051</a>)</li>
<li><a
href="https://github.com/sindresorhus/execa/commit/de8e7daabefbc6f4af36ef9647b37b6a0dfca7fa"><code>de8e7da</code></a>
Document minimum TypeScript version (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1050">#1050</a>)</li>
<li><a
href="https://github.com/sindresorhus/execa/commit/2d8475291b260aa79d2654793d9f6e8db88c06eb"><code>2d84752</code></a>
Export <code>TemplateExpression</code> type (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1049">#1049</a>)</li>
<li><a
href="https://github.com/sindresorhus/execa/commit/b8c131ce8ef2c3c1ec0c4dc3a7059c0d59ef28d9"><code>b8c131c</code></a>
9.0.2</li>
<li><a
href="https://github.com/sindresorhus/execa/commit/e2903e990fa04f0c15e3c2cf27ebd04ce332a60d"><code>e2903e9</code></a>
Run TypeScript on the types (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1042">#1042</a>)</li>
<li><a
href="https://github.com/sindresorhus/execa/commit/ab2a9ed13cde3f88696a2b0a8eef6c98e0022bb5"><code>ab2a9ed</code></a>
Fix type of result when using the <code>reject: false</code> option (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1046">#1046</a>)</li>
<li><a
href="https://github.com/sindresorhus/execa/commit/11bbd9d6411644764526c3fa1942c0a650caa25f"><code>11bbd9d</code></a>
Fix type of <code>TransformStream</code> (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1044">#1044</a>)</li>
<li><a
href="https://github.com/sindresorhus/execa/commit/6f4941e2a13c0f356ca3064327f5e2802e9180ac"><code>6f4941e</code></a>
Fix typing of web streams (<a
href="https://redirect.github.com/sindresorhus/execa/issues/1043">#1043</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/sindresorhus/execa/compare/v8.0.1...v9.1.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>
2024-06-02 21:38:14 -07:00
2023-11-02 22:23:07 -07:00
2023-11-02 22:23:07 -07:00
2024-05-01 18:16:16 +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
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)

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. Escaped newlines (\\n) will be automatically replaced with actual newlines.

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 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%