Compare commits

...

22 Commits

Author SHA1 Message Date
semantic-release-bot d400084c45 build(release): 1.3.0 [skip ci]
# [1.3.0](https://github.com/actions/create-github-app-token/compare/v1.2.2...v1.3.0) (2023-10-04)

### Features

* support tokens scoped to multiple repositories within organization ([#46](https://github.com/actions/create-github-app-token/issues/46)) ([20fd863](https://github.com/actions/create-github-app-token/commit/20fd86373fdcbeffde8b73b17ebb3a7a62c6c407))
2023-10-04 05:29:18 +00:00
Tim Reimherr 20fd86373f feat: support tokens scoped to multiple repositories within organization (#46)
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
2023-10-03 22:28:48 -07:00
semantic-release-bot 5804f049e1 build(release): 1.2.2 [skip ci]
## [1.2.2](https://github.com/actions/create-github-app-token/compare/v1.2.1...v1.2.2) (2023-10-02)

### Bug Fixes

* **deps:** bump the production-dependencies group with 3 updates ([#51](https://github.com/actions/create-github-app-token/issues/51)) ([6d98b25](https://github.com/actions/create-github-app-token/commit/6d98b259d9c6bef17db279eb4aefbbd031400ba4)), closes [#1511](https://github.com/actions/create-github-app-token/issues/1511) [#535](https://github.com/actions/create-github-app-token/issues/535) [#535](https://github.com/actions/create-github-app-token/issues/535) [#533](https://github.com/actions/create-github-app-token/issues/533) [#531](https://github.com/actions/create-github-app-token/issues/531) [#530](https://github.com/actions/create-github-app-token/issues/530) [#524](https://github.com/actions/create-github-app-token/issues/524) [#637](https://github.com/actions/create-github-app-token/issues/637) [#637](https://github.com/actions/create-github-app-token/issues/637) [#631](https://github.com/actions/create-github-app-token/issues/631) [#626](https://github.com/actions/create-github-app-token/issues/626)
2023-10-02 04:28:50 +00:00
dependabot[bot] 84daa2c0f0 build(deps-dev): bump the development-dependencies group with 2 updates (#52)
Bumps the development-dependencies group with 2 updates:
[esbuild](https://github.com/evanw/esbuild) and
[undici](https://github.com/nodejs/undici).

Updates `esbuild` from 0.19.2 to 0.19.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.19.4</h2>
<ul>
<li>
<p>Fix printing of JavaScript decorators in tricky cases (<a
href="https://redirect.github.com/evanw/esbuild/issues/3396">#3396</a>)</p>
<p>This release fixes some bugs where esbuild's pretty-printing of
JavaScript decorators could incorrectly produced code with a syntax
error. The problem happened because esbuild sometimes substitutes
identifiers for other expressions in the pretty-printer itself, but the
decision about whether to wrap the expression or not didn't account for
this. Here are some examples:</p>
<pre lang="js"><code>// Original code
import { constant } from './constants.js'
import { imported } from 'external'
import { undef } from './empty.js'
class Foo {
  @constant()
  @imported()
  @undef()
  foo
}
<p>// Old output (with --bundle --format=cjs --packages=external
--minify-syntax)
var import_external = require(&quot;external&quot;);
var Foo = class {
<a href="https://github.com/123"><code>@​123</code></a>()
@(0, import_external.imported)()
@(void 0)()
foo;
};</p>
<p>// New output (with --bundle --format=cjs --packages=external
--minify-syntax)
var import_external = require(&quot;external&quot;);
var Foo = class {
@(123())
@((0, import_external.imported)())
@((void 0)())
foo;
};
</code></pre></p>
</li>
<li>
<p>Allow pre-release versions to be passed to <code>target</code> (<a
href="https://redirect.github.com/evanw/esbuild/issues/3388">#3388</a>)</p>
<p>People want to be able to pass version numbers for unreleased
versions of node (which have extra stuff after the version numbers) to
esbuild's <code>target</code> setting and have esbuild do something
reasonable with them. These version strings are of course not present in
esbuild's internal feature compatibility table because an unreleased
version has not been released yet (by definition). With this release,
esbuild will now attempt to accept these version strings passed to
<code>target</code> and do something reasonable with them.</p>
</li>
</ul>
<h2>v0.19.3</h2>
<ul>
<li>
<p>Fix <code>list-style-type</code> with the <code>local-css</code>
loader (<a
href="https://redirect.github.com/evanw/esbuild/issues/3325">#3325</a>)</p>
<p>The <code>local-css</code> loader incorrectly treated all identifiers
provided to <code>list-style-type</code> as a custom local identifier.
That included identifiers such as <code>none</code> which have special
meaning in CSS, and which should not be treated as custom local
identifiers. This release fixes this bug:</p>
<pre lang="css"><code>/* Original code */
ul { list-style-type: none }
<p>/* Old output (with --loader=local-css) */
</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.19.4</h2>
<ul>
<li>
<p>Fix printing of JavaScript decorators in tricky cases (<a
href="https://redirect.github.com/evanw/esbuild/issues/3396">#3396</a>)</p>
<p>This release fixes some bugs where esbuild's pretty-printing of
JavaScript decorators could incorrectly produced code with a syntax
error. The problem happened because esbuild sometimes substitutes
identifiers for other expressions in the pretty-printer itself, but the
decision about whether to wrap the expression or not didn't account for
this. Here are some examples:</p>
<pre lang="js"><code>// Original code
import { constant } from './constants.js'
import { imported } from 'external'
import { undef } from './empty.js'
class Foo {
  @constant()
  @imported()
  @undef()
  foo
}
<p>// Old output (with --bundle --format=cjs --packages=external
--minify-syntax)
var import_external = require(&quot;external&quot;);
var Foo = class {
<a href="https://github.com/123"><code>@​123</code></a>()
@(0, import_external.imported)()
@(void 0)()
foo;
};</p>
<p>// New output (with --bundle --format=cjs --packages=external
--minify-syntax)
var import_external = require(&quot;external&quot;);
var Foo = class {
@(123())
@((0, import_external.imported)())
@((void 0)())
foo;
};
</code></pre></p>
</li>
<li>
<p>Allow pre-release versions to be passed to <code>target</code> (<a
href="https://redirect.github.com/evanw/esbuild/issues/3388">#3388</a>)</p>
<p>People want to be able to pass version numbers for unreleased
versions of node (which have extra stuff after the version numbers) to
esbuild's <code>target</code> setting and have esbuild do something
reasonable with them. These version strings are of course not present in
esbuild's internal feature compatibility table because an unreleased
version has not been released yet (by definition). With this release,
esbuild will now attempt to accept these version strings passed to
<code>target</code> and do something reasonable with them.</p>
</li>
</ul>
<h2>0.19.3</h2>
<ul>
<li>
<p>Fix <code>list-style-type</code> with the <code>local-css</code>
loader (<a
href="https://redirect.github.com/evanw/esbuild/issues/3325">#3325</a>)</p>
<p>The <code>local-css</code> loader incorrectly treated all identifiers
provided to <code>list-style-type</code> as a custom local identifier.
That included identifiers such as <code>none</code> which have special
meaning in CSS, and which should not be treated as custom local
identifiers. This release fixes this bug:</p>
<pre lang="css"><code>/* Original code */
ul { list-style-type: none }
</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/a75b16ec09e76a050cea8ad43588172dc297784d"><code>a75b16e</code></a>
publish 0.19.4 to npm</li>
<li><a
href="https://github.com/evanw/esbuild/commit/65a4439ff7c469ffc654f497fe3dee6bb1fa2ddb"><code>65a4439</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3396">#3396</a>:
js decorator pretty-printing bugs</li>
<li><a
href="https://github.com/evanw/esbuild/commit/6ad177c55bb5ea6f47cf741487308ee612c75222"><code>6ad177c</code></a>
add some js decorator printing tests</li>
<li><a
href="https://github.com/evanw/esbuild/commit/0e1696fdce7cd97d2d500358b69a4051f1417585"><code>0e1696f</code></a>
ignore <code>TP</code> in data from caniuse-lite</li>
<li><a
href="https://github.com/evanw/esbuild/commit/e7bf735c440c3e7ecc1b59826071ff6891f1691f"><code>e7bf735</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3390">#3390</a>:
allow <code>using</code> disposable functions (<a
href="https://redirect.github.com/evanw/esbuild/issues/3391">#3391</a>)</li>
<li><a
href="https://github.com/evanw/esbuild/commit/24bea0e759553755f73583c4d79c40d8a8bbf975"><code>24bea0e</code></a>
update <code>compat-table</code> (note: regexp unicode 15.1)</li>
<li><a
href="https://github.com/evanw/esbuild/commit/ea9c644db3c95cd264fa12f6d85fd67daabb51eb"><code>ea9c644</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3388">#3388</a>:
do something with pre-release versions</li>
<li><a
href="https://github.com/evanw/esbuild/commit/673ad10ff752486aa90749b63ebeb952c29106a1"><code>673ad10</code></a>
publish 0.19.3 to npm</li>
<li><a
href="https://github.com/evanw/esbuild/commit/6402f110e30d034d19a5f0410d3f5c6fdf86900b"><code>6402f11</code></a>
basic support for parsing import attributes</li>
<li><a
href="https://github.com/evanw/esbuild/commit/7ece5567511b25fa559082a8fd9aef8c23db66a1"><code>7ece556</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3322">#3322</a>:
avoid temporaries before <code>&quot;use strict&quot;</code></li>
<li>Additional commits viewable in <a
href="https://github.com/evanw/esbuild/compare/v0.19.2...v0.19.4">compare
view</a></li>
</ul>
</details>
<br />

Updates `undici` from 5.23.0 to 5.25.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>v5.25.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Add Khaf to releasers by <a
href="https://github.com/mcollina"><code>@​mcollina</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2276">nodejs/undici#2276</a></li>
<li>fix: fix request with readable mode is object by <a
href="https://github.com/killagu"><code>@​killagu</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2279">nodejs/undici#2279</a></li>
<li>fix loading websockets when node is built w/ --without-ssl by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2282">nodejs/undici#2282</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/killagu"><code>@​killagu</code></a> made
their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/2279">nodejs/undici#2279</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v5.25.1...v5.25.2">https://github.com/nodejs/undici/compare/v5.25.1...v5.25.2</a></p>
<h2>v5.25.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Add publish types script by <a
href="https://github.com/Ethan-Arrowood"><code>@​Ethan-Arrowood</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/2273">nodejs/undici#2273</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v5.25.0...v5.25.1">https://github.com/nodejs/undici/compare/v5.25.0...v5.25.1</a></p>
<h2>v5.25.0</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: h2 without body by <a
href="https://github.com/metcoder95"><code>@​metcoder95</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2258">nodejs/undici#2258</a></li>
<li>ci: remove duplicated runs by <a
href="https://github.com/metcoder95"><code>@​metcoder95</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2265">nodejs/undici#2265</a></li>
<li>improve documentation of timeouts by making the units clear in all
places by <a href="https://github.com/mcfedr"><code>@​mcfedr</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/2266">nodejs/undici#2266</a></li>
<li>expose websocket in node bundle by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2217">nodejs/undici#2217</a></li>
<li>test: fix Fetch/HTTP2 tests by <a
href="https://github.com/metcoder95"><code>@​metcoder95</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2263">nodejs/undici#2263</a></li>
<li>fix undici when node is built with --without-ssl by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2272">nodejs/undici#2272</a></li>
<li>fix: Fix type definition for Client Interceptors by <a
href="https://github.com/ComradeCow"><code>@​ComradeCow</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2269">nodejs/undici#2269</a></li>
<li>Fix http2 agent by <a
href="https://github.com/mcollina"><code>@​mcollina</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2275">nodejs/undici#2275</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/ComradeCow"><code>@​ComradeCow</code></a> made
their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/2269">nodejs/undici#2269</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v5.24.0...v5.25.0">https://github.com/nodejs/undici/compare/v5.24.0...v5.25.0</a></p>
<h2>v5.24.0</h2>
<h2>Notable Changes</h2>
<ul>
<li>feat: Add H2 support by <a
href="https://github.com/metcoder95"><code>@​metcoder95</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2061">nodejs/undici#2061</a></li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>build(deps): bump step-security/harden-runner from 2.4.1 to 2.5.0 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://redirect.github.com/nodejs/undici/pull/2203">nodejs/undici#2203</a></li>
<li>better stack trace for body.json by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2215">nodejs/undici#2215</a></li>
<li>allow http &amp; https websocket urls by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2218">nodejs/undici#2218</a></li>
<li>build(deps-dev): bump <code>@​sinonjs/fake-timers</code> from 10.3.0
to 11.1.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2221">nodejs/undici#2221</a></li>
<li>fix: pass ProxyAgent proxy status code error by <a
href="https://github.com/NBNGaming"><code>@​NBNGaming</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2162">nodejs/undici#2162</a></li>
<li>fix failing test by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2223">nodejs/undici#2223</a></li>
<li>docs: update MockPool.md intercept method description by <a
href="https://github.com/capaj"><code>@​capaj</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2220">nodejs/undici#2220</a></li>
<li>Update wpts by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2226">nodejs/undici#2226</a></li>
<li>build(deps): bump github/codeql-action from 2.21.2 to 2.21.5 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2240">nodejs/undici#2240</a></li>
<li>build(deps): bump actions/setup-node from 3.6.0 to 3.8.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2237">nodejs/undici#2237</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/4013c4b8932e73728809e4106d5c9d9d40648031"><code>4013c4b</code></a>
Bumped v5.25.2</li>
<li><a
href="https://github.com/nodejs/undici/commit/b85ac789de76d95de6db7d442b31feed46c671ca"><code>b85ac78</code></a>
fix loading websockets when node is built w/ --without-ssl (<a
href="https://redirect.github.com/nodejs/undici/issues/2282">#2282</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/ba95ff6cf622a4ce8d6d9d42da22ebf9f15685a0"><code>ba95ff6</code></a>
fix: fix request with readable mode is object (<a
href="https://redirect.github.com/nodejs/undici/issues/2279">#2279</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/a73260339fec7852b1c9a067b342bad0b87b20ee"><code>a732603</code></a>
Add Khaf to releasers (<a
href="https://redirect.github.com/nodejs/undici/issues/2276">#2276</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/c86279c9bcf62fe28d124b124b91eb364d478a25"><code>c86279c</code></a>
undici-types@5.25.1</li>
<li><a
href="https://github.com/nodejs/undici/commit/e8a667452cb00bf46a3bb62ee0d5af61723fb62a"><code>e8a6674</code></a>
5.25.1</li>
<li><a
href="https://github.com/nodejs/undici/commit/5c2e597bd938ce99a0246f9dfbfac6d3f3a31be9"><code>5c2e597</code></a>
Add publish types script (<a
href="https://redirect.github.com/nodejs/undici/issues/2273">#2273</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/985b3816708512bafefa1544def183cc6d1536be"><code>985b381</code></a>
Bumped v5.25.0</li>
<li><a
href="https://github.com/nodejs/undici/commit/d1e867e1cddbfed6ee405c8d8872ed4f0c964689"><code>d1e867e</code></a>
Fix http2 agent (<a
href="https://redirect.github.com/nodejs/undici/issues/2275">#2275</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/4d7c319d67a73f7284216ac38e81be4f94f70cde"><code>4d7c319</code></a>
Fix type definition for Client Interceptors (<a
href="https://redirect.github.com/nodejs/undici/issues/2269">#2269</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/nodejs/undici/compare/v5.23.0...v5.25.2">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>
2023-10-01 21:28:18 -07:00
dependabot[bot] 6d98b259d9 fix(deps): bump the production-dependencies group with 3 updates (#51)
Bumps the production-dependencies group with 3 updates:
[@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core),
[@octokit/auth-app](https://github.com/octokit/auth-app.js) and
[@octokit/request](https://github.com/octokit/request.js).

Updates `@actions/core` from 1.10.0 to 1.10.1
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md"><code>@​actions/core</code>'s
changelog</a>.</em></p>
<blockquote>
<h3>1.10.1</h3>
<ul>
<li>Fix error message reference in oidc utils <a
href="https://redirect.github.com/actions/toolkit/pull/1511">#1511</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/actions/toolkit/commits/HEAD/packages/core">compare
view</a></li>
</ul>
</details>
<br />

Updates `@octokit/auth-app` from 6.0.0 to 6.0.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/octokit/auth-app.js/releases"><code>@​octokit/auth-app</code>'s
releases</a>.</em></p>
<blockquote>
<h2>v6.0.1</h2>
<h2><a
href="https://github.com/octokit/auth-app.js/compare/v6.0.0...v6.0.1">6.0.1</a>
(2023-09-23)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>deps:</strong> update dependency
<code>@​octokit/types</code> to v12 (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/535">#535</a>)
(<a
href="https://github.com/octokit/auth-app.js/commit/d7157719c2d28f9ffdfada61139b0d4984723a65">d715771</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/octokit/auth-app.js/commit/d7157719c2d28f9ffdfada61139b0d4984723a65"><code>d715771</code></a>
fix(deps): update dependency <code>@​octokit/types</code> to v12 (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/535">#535</a>)</li>
<li><a
href="https://github.com/octokit/auth-app.js/commit/62cfc5bbce931e056852e91bdc3d479e3e399881"><code>62cfc5b</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
46da6c0</li>
<li><a
href="https://github.com/octokit/auth-app.js/commit/b1c796928a8d59af23749d06e1f75e5d047b28f8"><code>b1c7969</code></a>
build(deps): lock file maintenance (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/533">#533</a>)</li>
<li><a
href="https://github.com/octokit/auth-app.js/commit/f584646566c0de02e85cecf40015a44f15b22028"><code>f584646</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
1f6c514</li>
<li><a
href="https://github.com/octokit/auth-app.js/commit/414bea3cc3bab71bc0148747678bddb0a4c6b9f9"><code>414bea3</code></a>
build(deps): lock file maintenance (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/531">#531</a>)</li>
<li><a
href="https://github.com/octokit/auth-app.js/commit/47e4bd1660c3faed2690ade1086ef96657e0b88a"><code>47e4bd1</code></a>
build(deps): lock file maintenance (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/530">#530</a>)</li>
<li><a
href="https://github.com/octokit/auth-app.js/commit/5d3973e9355ba5fb8c1c65f5710722a58d75dfbc"><code>5d3973e</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
223779b</li>
<li><a
href="https://github.com/octokit/auth-app.js/commit/192bd894e4e2a71faf2e5996eb7287deb1ad7fdc"><code>192bd89</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
46846e5</li>
<li><a
href="https://github.com/octokit/auth-app.js/commit/77cb45b6542ca1dd5d0086864e28fea0ddbe9297"><code>77cb45b</code></a>
ci(action): update actions/checkout action to v4</li>
<li><a
href="https://github.com/octokit/auth-app.js/commit/1c0d530c6b85890853b860b16f0c11e106bb676f"><code>1c0d530</code></a>
build(deps): lock file maintenance (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/524">#524</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/octokit/auth-app.js/compare/v6.0.0...v6.0.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `@octokit/request` from 8.1.1 to 8.1.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/octokit/request.js/releases"><code>@​octokit/request</code>'s
releases</a>.</em></p>
<blockquote>
<h2>v8.1.2</h2>
<h2><a
href="https://github.com/octokit/request.js/compare/v8.1.1...v8.1.2">8.1.2</a>
(2023-09-23)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>deps:</strong> update dependency
<code>@​octokit/types</code> to v12 (<a
href="https://redirect.github.com/octokit/request.js/issues/637">#637</a>)
(<a
href="https://github.com/octokit/request.js/commit/8fa4d612ad80bdf4c4c7da0efd0d6ad47bb6978b">8fa4d61</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/octokit/request.js/commit/8fa4d612ad80bdf4c4c7da0efd0d6ad47bb6978b"><code>8fa4d61</code></a>
fix(deps): update dependency <code>@​octokit/types</code> to v12 (<a
href="https://redirect.github.com/octokit/request.js/issues/637">#637</a>)</li>
<li><a
href="https://github.com/octokit/request.js/commit/b4b18153458cdbeae099dcc072cac88d8e2a81c5"><code>b4b1815</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
46da6c0</li>
<li><a
href="https://github.com/octokit/request.js/commit/77683b9dd783675622720e44d6e281d95eb86ab3"><code>77683b9</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
1f6c514</li>
<li><a
href="https://github.com/octokit/request.js/commit/45f319bac6c1281e42e989f4b97cf45cf8e4cd40"><code>45f319b</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
223779b</li>
<li><a
href="https://github.com/octokit/request.js/commit/d0a545f389d55a6677bd2ad4084fca7958ba9ade"><code>d0a545f</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
46846e5 (<a
href="https://redirect.github.com/octokit/request.js/issues/631">#631</a>)</li>
<li><a
href="https://github.com/octokit/request.js/commit/1ba853ad70ba0c8e856f89628aa1df0e26aadc75"><code>1ba853a</code></a>
ci(action): update actions/checkout action to v4</li>
<li><a
href="https://github.com/octokit/request.js/commit/5f5c4bf1d7acb9670c5347051afb62f9453e7121"><code>5f5c4bf</code></a>
chore(deps): update dependency prettier to v3.0.3</li>
<li><a
href="https://github.com/octokit/request.js/commit/f964d3d249698d6fd656dd978876c8d84e20c09c"><code>f964d3d</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
94ff342</li>
<li><a
href="https://github.com/octokit/request.js/commit/29edb28325de3a60442e15c7d45f20be9c4d350d"><code>29edb28</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
8c21c80</li>
<li><a
href="https://github.com/octokit/request.js/commit/05eb0a9ab60922ea7b283082afb89798c4eb6108"><code>05eb0a9</code></a>
ci(action): update peter-evans/create-or-update-comment digest to
bb291f6 (<a
href="https://redirect.github.com/octokit/request.js/issues/626">#626</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/octokit/request.js/compare/v8.1.1...v8.1.2">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>
2023-10-01 21:28:07 -07:00
dependabot[bot] 3629f23f43 build(deps): bump actions/checkout from 3 to 4 (#53) 2023-10-01 21:27:42 -07:00
Gregor Martynus 4bb2d37925 ci(test): do not run end-to-end tests in PRs from forks (#48) 2023-09-21 16:34:10 -07:00
Gregor Martynus 9f83520638 ci(test): actually run integrration tests (#47) 2023-09-21 13:53:30 -07:00
Parker Brown 10f155294b test: integration tests (#40)
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2023-09-05 08:32:55 -07:00
semantic-release-bot 49ce228ea7 build(release): 1.2.1 [skip ci]
## [1.2.1](https://github.com/actions/create-github-app-token/compare/v1.2.0...v1.2.1) (2023-08-30)

### Bug Fixes

* **GHES:** respect `GITHUB_API_URL` when creating installation access token ([#38](https://github.com/actions/create-github-app-token/issues/38)) ([c08c5ac](https://github.com/actions/create-github-app-token/commit/c08c5ace340664df431bf7f11d51b61d92358c2b)), closes [#36](https://github.com/actions/create-github-app-token/issues/36)
2023-08-30 05:30:14 +00:00
Gregor Martynus c08c5ace34 fix(GHES): respect GITHUB_API_URL when creating installation access token (#38)
Follow up to #36. I just wanted to do some refactoring but turns out I
missed to pass the custom `request` instance to `createAppAuth`. It will
fallback to the default `request` which does not respect
`GITHUB_API_URL`
2023-08-29 22:29:41 -07:00
semantic-release-bot c72844caa4 build(release): 1.2.0 [skip ci]
# [1.2.0](https://github.com/actions/create-github-app-token/compare/v1.1.5...v1.2.0) (2023-08-29)

### Features

* add GitHub Enterprise Server (GHES) support ([#36](https://github.com/actions/create-github-app-token/issues/36)) ([ede6c15](https://github.com/actions/create-github-app-token/commit/ede6c158812854da7c63aa6635138d168de14bea))
2023-08-29 23:14:09 +00:00
7Hazard ede6c15881 feat: add GitHub Enterprise Server (GHES) support (#36)
This adds support for this action to be used in GitHub Enterprise
Server.

It sends request to the base url extracted from
[GITHUB_API_URL](https://docs.github.com/en/enterprise-server@3.10/actions/learn-github-actions/variables#default-environment-variables).

---------

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2023-08-29 16:13:34 -07:00
semantic-release-bot 17cde8a7d8 build(release): 1.1.5 [skip ci]
## [1.1.5](https://github.com/actions/create-github-app-token/compare/v1.1.4...v1.1.5) (2023-08-28)

### Bug Fixes

* **release:** update version in `package.json` ([#35](https://github.com/actions/create-github-app-token/issues/35)) ([1dccc4c](https://github.com/actions/create-github-app-token/commit/1dccc4ccc6e1df7d6adc1bde339ce0d7a2ea7df7)), closes [#34](https://github.com/actions/create-github-app-token/issues/34)
2023-08-28 22:38:26 +00:00
Gregor Martynus 1dccc4ccc6 fix(release): update version in package.json (#35)
closes #34

Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
2023-08-28 15:37:47 -07:00
semantic-release-bot 35d8ea9fdb build(release): 1.1.4 [skip ci]
## [1.1.4](https://github.com/actions/create-github-app-token/compare/v1.1.3...v1.1.4) (2023-08-28)

### Bug Fixes

* **release:** build `dist/` before release ([#33](https://github.com/actions/create-github-app-token/issues/33)) ([9a6a017](https://github.com/actions/create-github-app-token/commit/9a6a017c104eb1b36533ee8195e814f567934ce8)), closes [#32](https://github.com/actions/create-github-app-token/issues/32)
2023-08-28 22:29:27 +00:00
Gregor Martynus 9a6a017c10 fix(release): build dist/ before release (#33)
closes #32
2023-08-28 15:28:55 -07:00
David Sanders 2540ed49e5 fix: check for token before revoking (#30)
Check before trying to revoke the token, in case the token generation
failed. Otherwise the post step will throw an error.

---------

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2023-08-28 15:14:31 -07:00
Josh Gross 5611f921d9 docs(README): clarify token masking (#29)
With #13, this action is explicitly masking the token so we don't need to mention that we're relying on a specific format of GitHub tokens being masked by the runner.
2023-08-25 21:51:50 -07:00
Parker Brown bc256c234b fix: mask the installation token in logs (#28)
The runner will automatically mask GitHub token formats it recognizes,
but sometimes a new pattern rolls out before the runner is updated to
recognize it.
2023-08-25 11:59:01 -07:00
Parker Brown 04f8ace9a0 build(dependabot): group dependency updates by type and configure commit prefixes (#27)
- Group production and development dependency updates
- Configure dependency update commit prefixes to release on production
dependency updates

  Dependabot commit messages before:

  - `build(deps): bump semver from 7.5.1 to 7.5.4`
  - `build(deps-dev): bump dotenv from 16.0.3 to 16.3.1`

  Dependabot commit messages after:

  - `fix(deps): bump semver from 7.5.1 to 7.5.4`
- `build(deps-dev): bump dotenv from 16.0.3 to 16.3.1` (no change to dev
dependencies)
2023-08-25 09:01:54 -07:00
Parker Brown 4fd0ce7c29 ci(test): run on pull request and add concurrency configuration (#17)
- Run test on pull requests to the main branch instead of on every push
- Cancel in-progress workflows if a PR is updated (i.e., a new commit is
pushed) and the same workflows are triggered to run again
- Rename step ID from `demo` to `test`

---------

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2023-08-24 15:30:49 -07:00
20 changed files with 4163 additions and 12617 deletions
+9
View File
@@ -4,6 +4,15 @@ updates:
directory: "/"
schedule:
interval: "monthly"
groups:
production-dependencies:
dependency-type: "production"
development-dependencies:
dependency-type: "development"
commit-message:
prefix: "fix"
prefix-development: "build"
include: "scope"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
+3 -2
View File
@@ -19,10 +19,11 @@ jobs:
with:
app_id: ${{ vars.RELEASER_APP_ID }}
private_key: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- run: npm install --no-save @semantic-release/git semantic-release-plugin-github-breaking-version-tag
- run: npx semantic-release
- run: npm run build
- run: npx semantic-release --debug
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
+29 -6
View File
@@ -1,26 +1,49 @@
name: test
on: [push]
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
integration:
name: Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "16.16"
node-version: 20
cache: "npm"
- run: npm ci
- run: npm test
end-to-end:
name: End-to-End
runs-on: ubuntu-latest
# do not run from forks, as forks dont have access to repository secrets
if: github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
- run: npm ci
- run: npm run build
- uses: ./ # Uses the action in the root directory
id: demo
id: test
with:
app_id: ${{ vars.TEST_APP_ID }}
private_key: ${{ secrets.TEST_APP_PRIVATE_KEY }}
- uses: octokit/request-action@v2.x
id: get-repository
env:
GITHUB_TOKEN: ${{ steps.demo.outputs.token }}
GITHUB_TOKEN: ${{ steps.test.outputs.token }}
with:
route: GET /installation/repositories
- run: echo '${{ steps.get-repository.outputs.data }}'
+81 -3
View File
@@ -10,7 +10,7 @@ In order to use this action, you need to:
2. [Store the App's ID in your repository environment variables](https://docs.github.com/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows) (example: `APP_ID`)
3. [Store the App's private key in your repository secrets](https://docs.github.com/actions/security-guides/encrypted-secrets?tool=webui#creating-encrypted-secrets-for-a-repository) (example: `PRIVATE_KEY`)
### Minimal usage
### Create a token for the current repository
```yaml
on: [issues]
@@ -57,6 +57,73 @@ jobs:
github_token: ${{ steps.app-token.outputs.token }}
```
### Create a token for all repositories in the current owner's installation
```yaml
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
```yaml
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
```yaml
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!"
```
## Inputs
### `app_id`
@@ -67,6 +134,17 @@ jobs:
**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 `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.
## Outputs
### `token`
@@ -77,11 +155,11 @@ GitHub App installation access token.
The action creates an installation access token using [the `POST /app/installations/{installation_id}/access_tokens` endpoint](https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app). By default,
1. The token is scoped to the current repository.
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. 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. That is not a feature by the action, but by the GitHub Actions runner itself, due to the specific format of GitHub tokens.
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.
+6
View File
@@ -11,6 +11,12 @@ inputs:
private_key:
description: "GitHub App private key"
required: true
owner:
description: "GitHub App owner (defaults to current repository owner)"
required: false
repositories:
description: "Repositories to install the GitHub App on (defaults to current repository if owner is unset)"
required: false
outputs:
token:
description: "GitHub installation access token"
+1431 -9185
View File
File diff suppressed because one or more lines are too long
+284 -3217
View File
File diff suppressed because one or more lines are too long
+94 -27
View File
@@ -1,59 +1,126 @@
// @ts-check
import core from "@actions/core";
import { createAppAuth } from "@octokit/auth-app";
import { request } from "@octokit/request";
/**
* @param {string} appId
* @param {string} privateKey
* @param {string} repository
* @param {core} core
* @param {createAppAuth} createAppAuth
* @param {request} request
* @param {string} owner
* @param {string} repositories
* @param {import("@actions/core")} core
* @param {import("@octokit/auth-app").createAppAuth} createAppAuth
* @param {import("@octokit/request").request} request
*/
export async function main(
appId,
privateKey,
repository,
owner,
repositories,
core,
createAppAuth,
request
) {
// Get owner and repo name from GITHUB_REPOSITORY
const [owner, repo] = repository.split("/");
let parsedOwner = "";
let parsedRepositoryNames = "";
// If neither owner nor repositories are set, default to current repository
if (!owner && !repositories) {
[parsedOwner, parsedRepositoryNames] = String(
process.env.GITHUB_REPOSITORY
).split("/");
core.info(
`owner and repositories not set, creating token for the current repository ("${parsedRepositoryNames}")`
);
}
// If only an owner is set, default to all repositories from that owner
if (owner && !repositories) {
parsedOwner = owner;
core.info(
`repositories not set, creating token for all repositories for given owner "${owner}"`
);
}
// If repositories are set, but no owner, default to `GITHUB_REPOSITORY_OWNER`
if (!owner && repositories) {
parsedOwner = String(process.env.GITHUB_REPOSITORY_OWNER);
parsedRepositoryNames = repositories;
core.info(
`owner not set, creating owner for given repositories "${repositories}" in current owner ("${parsedOwner}")`
);
}
// If both owner and repositories are set, use those values
if (owner && repositories) {
parsedOwner = owner;
parsedRepositoryNames = repositories;
core.info(
`owner and repositories set, creating token for repositories "${repositories}" owned by "${owner}"`
);
}
const auth = createAppAuth({
appId,
privateKey,
request,
});
const appAuthentication = await auth({
type: "app",
});
// Get the installation ID
// https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app
const { data: installation } = await request(
"GET /repos/{owner}/{repo}/installation",
{
owner,
repo,
let authentication;
// If at least one repository is set, get installation ID from that repository
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app
if (parsedRepositoryNames) {
const response = await request("GET /repos/{owner}/{repo}/installation", {
owner: parsedOwner,
repo: parsedRepositoryNames.split(",")[0],
headers: {
authorization: `bearer ${appAuthentication.token}`,
},
}
);
});
// Create a new installation token
const authentication = await auth({
type: "installation",
installationId: installation.id,
repositoryNames: [repo],
});
// Get token for given repositories
authentication = await auth({
type: "installation",
installationId: response.data.id,
repositoryNames: parsedRepositoryNames.split(","),
});
} else {
// Otherwise get the installation for the owner, which can either be an organization or a user account
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app
const response = await request("GET /orgs/{org}/installation", {
org: parsedOwner,
headers: {
authorization: `bearer ${appAuthentication.token}`,
},
}).catch((error) => {
if (error.status !== 404) throw error;
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app
return request("GET /users/{username}/installation", {
username: parsedOwner,
headers: {
authorization: `bearer ${appAuthentication.token}`,
},
});
});
// Get token for for all repositories of the given installation
authentication = await auth({
type: "installation",
installationId: response.data.id,
});
}
// Register the token with the runner as a secret to ensure it is masked in logs
core.setSecret(authentication.token);
core.setOutput("token", authentication.token);
// Make token accessible to post function (so we can invalidate it)
core.saveState("token", authentication.token);
}
+7 -5
View File
@@ -1,15 +1,17 @@
// @ts-check
import core from "@actions/core";
import { request } from "@octokit/request";
/**
* @param {core} core
* @param {request} request
* @param {import("@actions/core")} core
* @param {import("@octokit/request").request} request
*/
export async function post(core, request) {
const token = core.getState("token");
if (!token) {
core.info("Token is not set");
return;
}
await request("DELETE /installation/token", {
headers: {
authorization: `token ${token}`,
+8
View File
@@ -0,0 +1,8 @@
import { request } from "@octokit/request";
export default request.defaults({
baseUrl: process.env["GITHUB_API_URL"],
headers: {
"user-agent": "actions/create-github-app-token",
},
});
+21 -9
View File
@@ -2,22 +2,34 @@
import core from "@actions/core";
import { createAppAuth } from "@octokit/auth-app";
import { request } from "@octokit/request";
import { main } from "./lib/main.js";
import request from "./lib/request.js";
if (!process.env.GITHUB_REPOSITORY) {
throw new Error("GITHUB_REPOSITORY missing, must be set to '<owner>/<repo>'");
}
if (!process.env.GITHUB_REPOSITORY_OWNER) {
throw new Error("GITHUB_REPOSITORY_OWNER missing, must be set to '<owner>'");
}
const appId = core.getInput("app_id");
const privateKey = core.getInput("private_key");
const owner = core.getInput("owner");
const repositories = core.getInput("repositories");
const repository = process.env.GITHUB_REPOSITORY;
main(appId, privateKey, repository, core, createAppAuth, request).catch(
(error) => {
console.error(error);
core.setFailed(error.message);
}
);
main(
appId,
privateKey,
owner,
repositories,
core,
createAppAuth,
request.defaults({
baseUrl: process.env["GITHUB_API_URL"],
})
).catch((error) => {
console.error(error);
core.setFailed(error.message);
});
+2082 -150
View File
File diff suppressed because it is too large Load Diff
+10 -6
View File
@@ -2,21 +2,24 @@
"name": "create-github-app-token",
"private": true,
"type": "module",
"version": "1.0.5",
"version": "1.3.0",
"description": "GitHub Action for creating a GitHub App Installation Access Token",
"scripts": {
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node16.16",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "ava tests/index.js"
},
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.0",
"@octokit/auth-app": "^6.0.0",
"@octokit/request": "^8.1.1"
"@actions/core": "^1.10.1",
"@octokit/auth-app": "^6.0.1",
"@octokit/request": "^8.1.2"
},
"devDependencies": {
"ava": "^5.3.1",
"dotenv": "^16.3.1",
"esbuild": "^0.19.2"
"esbuild": "^0.19.4",
"execa": "^8.0.1",
"undici": "^5.25.2"
},
"release": {
"branches": [
@@ -27,6 +30,7 @@
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"@semantic-release/npm",
"semantic-release-plugin-github-breaking-version-tag",
[
"@semantic-release/git",
+10 -7
View File
@@ -1,13 +1,16 @@
// @ts-check
import core from "@actions/core";
import { request } from "@octokit/request";
import { post } from "./lib/post.js";
import request from "./lib/request.js";
post(core, request).catch(
(error) => {
console.error(error);
core.setFailed(error.message);
}
);
post(
core,
request.defaults({
baseUrl: process.env["GITHUB_API_URL"],
})
).catch((error) => {
console.error(error);
core.setFailed(error.message);
});
+19
View File
@@ -0,0 +1,19 @@
# Tests
Add one test file per scenario. You can run them in isolation with:
```bash
node tests/post-token-set.test.js
```
All tests are run together in [tests/index.js](index.js), which can be execauted with ava
```
npx ava tests/index.js
```
or with npm
```
npm test
```
+14
View File
@@ -0,0 +1,14 @@
import { readdirSync } from "node:fs";
import { execa } from "execa";
import test from "ava";
const tests = readdirSync("tests").filter((file) => file.endsWith(".test.js"));
for (const file of tests) {
test(file, async (t) => {
const { stderr, stdout } = await execa("node", [`tests/${file}`]);
t.snapshot(stderr, "stderr");
t.snapshot(stdout, "stdout");
});
}
+25
View File
@@ -0,0 +1,25 @@
import { MockAgent, setGlobalDispatcher } from "undici";
// state variables are set as environment variables with the prefix STATE_
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions
process.env.STATE_token = "secret123";
const mockAgent = new MockAgent();
setGlobalDispatcher(mockAgent);
// Provide the base url to the request
const mockPool = mockAgent.get("https://api.github.com");
// intercept the request
mockPool
.intercept({
path: "/installation/token",
method: "DELETE",
headers: {
authorization: "token secret123",
},
})
.reply(204);
await import("../post.js");
+5
View File
@@ -0,0 +1,5 @@
// state variables are set as environment variables with the prefix STATE_
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions
delete process.env.STATE_token;
await import("../post.js");
+25
View File
@@ -0,0 +1,25 @@
# Snapshot report for `tests/index.js`
The actual snapshot is saved in `index.js.snap`.
Generated by [AVA](https://avajs.dev).
## post-token-set.test.js
> stderr
''
> stdout
'Token revoked'
## post-token-unset.test.js
> stderr
''
> stdout
'Token is not set'
Binary file not shown.