Compare commits

..

7 Commits

Author SHA1 Message Date
semantic-release-bot
86576b355d build(release): 1.7.0 [skip ci]
# [1.7.0](https://github.com/actions/create-github-app-token/compare/v1.6.4...v1.7.0) (2024-01-26)

### Features

* `github-api-url` ([#88](https://github.com/actions/create-github-app-token/issues/88)) ([837e275](837e2752e0)), closes [#77](https://github.com/actions/create-github-app-token/issues/77)
2024-01-26 18:51:44 +00:00
Gregor Martynus
837e2752e0 feat: github-api-url (#88)
closes #77

---------

Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
2024-01-26 10:51:16 -08:00
semantic-release-bot
c4fa18d55c build(release): 1.6.4 [skip ci]
## [1.6.4](https://github.com/actions/create-github-app-token/compare/v1.6.3...v1.6.4) (2024-01-19)

### Bug Fixes

* **revocation:** avoid revoking expired tokens and fail gracefully ([#95](https://github.com/actions/create-github-app-token/issues/95)) ([0c01407](0c014070f9)), closes [#72](https://github.com/actions/create-github-app-token/issues/72)
2024-01-19 15:45:52 +00:00
Josh Gross
0c014070f9 fix(revocation): avoid revoking expired tokens and fail gracefully (#95)
Fixes #72

If an Actions job is long enough, more than an hour can pass between
creating and revoking the App token in the post-job clean up step. Since
the token itself is used to authenticate with the revoke API, an expired
token will fail to be revoked.

This PR saves the token expiration in the actions state and uses that in
the post step to determine if the token can be revoked. I've also added
error handling to the revoke token API call, as it's unlikely that users
would want their job to fail if the token can't be revoked.
2024-01-19 07:45:12 -08:00
semantic-release-bot
f04aa94d10 build(release): 1.6.3 [skip ci]
## [1.6.3](https://github.com/actions/create-github-app-token/compare/v1.6.2...v1.6.3) (2024-01-09)

### Bug Fixes

* **deps:** bump the production-dependencies group with 2 updates ([#94](https://github.com/actions/create-github-app-token/issues/94)) ([323044f](323044ff31)), closes [#562](https://github.com/actions/create-github-app-token/issues/562) [#557](https://github.com/actions/create-github-app-token/issues/557) [#562](https://github.com/actions/create-github-app-token/issues/562) [#560](https://github.com/actions/create-github-app-token/issues/560) [#559](https://github.com/actions/create-github-app-token/issues/559) [#558](https://github.com/actions/create-github-app-token/issues/558) [#557](https://github.com/actions/create-github-app-token/issues/557) [#553](https://github.com/actions/create-github-app-token/issues/553) [#552](https://github.com/actions/create-github-app-token/issues/552) [#551](https://github.com/actions/create-github-app-token/issues/551) [#75](https://github.com/actions/create-github-app-token/issues/75) [#75](https://github.com/actions/create-github-app-token/issues/75)
2024-01-09 22:21:09 +00:00
dependabot[bot]
323044ff31 fix(deps): bump the production-dependencies group with 2 updates (#94)
Bumps the production-dependencies group with 2 updates:
[@octokit/auth-app](https://github.com/octokit/auth-app.js) and
[p-retry](https://github.com/sindresorhus/p-retry).

Updates `@octokit/auth-app` from 6.0.1 to 6.0.3
<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.3</h2>
<h2><a
href="https://github.com/octokit/auth-app.js/compare/v6.0.2...v6.0.3">6.0.3</a>
(2024-01-09)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>dependencies:</strong> bump universal-github-app-jwt to
1.1.2 (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/562">#562</a>)
(<a
href="52346fed07">52346fe</a>)</li>
</ul>
<h2>v6.0.2</h2>
<h2><a
href="https://github.com/octokit/auth-app.js/compare/v6.0.1...v6.0.2">6.0.2</a>
(2023-12-18)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>types:</strong> update <code>Cache#get</code> to allow
<code>Promise</code> return type (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/557">#557</a>)
(<a
href="f5e57aa12e">f5e57aa</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="52346fed07"><code>52346fe</code></a>
fix(dependencies): bump universal-github-app-jwt to 1.1.2 (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/562">#562</a>)</li>
<li><a
href="aa7d921e1d"><code>aa7d921</code></a>
build(deps): lock file maintenance (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/560">#560</a>)</li>
<li><a
href="cb73ca4c35"><code>cb73ca4</code></a>
build(deps): lock file maintenance (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/559">#559</a>)</li>
<li><a
href="5d261b118b"><code>5d261b1</code></a>
build(deps): lock file maintenance (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/558">#558</a>)</li>
<li><a
href="f5e57aa12e"><code>f5e57aa</code></a>
fix(types): update <code>Cache#get</code> to allow <code>Promise</code>
return type (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/557">#557</a>)</li>
<li><a
href="5fdc2f19e0"><code>5fdc2f1</code></a>
build(deps): lock file maintenance</li>
<li><a
href="dda3b52a17"><code>dda3b52</code></a>
ci(action): update github/codeql-action action to v3</li>
<li><a
href="8bbd972db1"><code>8bbd972</code></a>
immediate-response uses pull_request_target trigger (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/553">#553</a>)</li>
<li><a
href="28cdca80d0"><code>28cdca8</code></a>
chore(deps): update dependency prettier to v3.1.1 (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/552">#552</a>)</li>
<li><a
href="64eacb2776"><code>64eacb2</code></a>
build(deps): lock file maintenance (<a
href="https://redirect.github.com/octokit/auth-app.js/issues/551">#551</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/octokit/auth-app.js/compare/v6.0.1...v6.0.3">compare
view</a></li>
</ul>
</details>
<br />

Updates `p-retry` from 6.1.0 to 6.2.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/sindresorhus/p-retry/releases">p-retry's
releases</a>.</em></p>
<blockquote>
<h2>v6.2.0</h2>
<ul>
<li>Add <a
href="https://github.com/sindresorhus/p-retry#shouldretryerror"><code>shouldRetry</code></a>
option (<a
href="https://redirect.github.com/sindresorhus/p-retry/issues/75">#75</a>)
b993a96</li>
</ul>
<p><a
href="https://github.com/sindresorhus/p-retry/compare/v6.1.0...v6.2.0">https://github.com/sindresorhus/p-retry/compare/v6.1.0...v6.2.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="21a22dd094"><code>21a22dd</code></a>
6.2.0</li>
<li><a
href="e7d8789d43"><code>e7d8789</code></a>
Meta tweaks</li>
<li><a
href="b993a96738"><code>b993a96</code></a>
Add <code>shouldRetry</code> option (<a
href="https://redirect.github.com/sindresorhus/p-retry/issues/75">#75</a>)</li>
<li>See full diff in <a
href="https://github.com/sindresorhus/p-retry/compare/v6.1.0...v6.2.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-01-09 14:20:33 -08:00
dependabot[bot]
936979e9ad build(deps-dev): bump the development-dependencies group with 4 updates
Bumps the development-dependencies group with 4 updates:
[ava](https://github.com/avajs/ava),
[esbuild](https://github.com/evanw/esbuild),
[open-cli](https://github.com/sindresorhus/open-cli) and
[undici](https://github.com/nodejs/undici).

Updates `ava` from 5.3.1 to 6.0.1
<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.0.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Ensure watch mode works outside of its integration tests by <a
href="https://github.com/novemberborn"><code>@​novemberborn</code></a>
in <a
href="https://redirect.github.com/avajs/ava/pull/3273">avajs/ava#3273</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/avajs/ava/compare/v6.0.0...v6.0.1">https://github.com/avajs/ava/compare/v6.0.0...v6.0.1</a></p>
<h2>v6.0.0</h2>
<h2>Breaking Changes</h2>
<ul>
<li>
<p>AVA now requires Node.js versions 18.18, 20.8 or 21. Versions 14 and
16 are no longer supported. <a
href="https://redirect.github.com/avajs/ava/issues/3251">#3251</a> <a
href="https://redirect.github.com/avajs/ava/issues/3216">#3216</a></p>
</li>
<li>
<p>When tests finish, worker threads or child processes are no longer
exited through <code>proces.exit()</code>. If your test file does not
exit on its own, the test run will time out. <a
href="https://redirect.github.com/avajs/ava/issues/3260">#3260</a></p>
</li>
<li>
<p>Changes to watch mode <a
href="https://redirect.github.com/avajs/ava/issues/3218">#3218</a>:</p>
<ul>
<li>Watch mode can no longer be started via the
<code>ava.config.*</code> or <code>package.json</code>
configuration.</li>
<li>The <code>ignoredByWatcher</code> configuration has moved to the
<code>watchMode</code> object, under the <code>ignoreChanges</code>
key.</li>
<li>Watch mode now uses the built-in <a
href="https://nodejs.org/api/fs.html#fswatchfilename-options-listener"><code>fs.watch()</code></a>
in recursive mode. This is supported on Linux in Node.js 20 or newer,
and MacOS and Windows in Node.js 18 as well. There are <a
href="https://nodejs.org/api/fs.html#caveats">caveats</a> to keep in
mind.</li>
</ul>
</li>
<li>
<p>Failed assertions now throw, meaning that any subsequent code is not
executed. This also impacts the type definitions. <a
href="https://redirect.github.com/avajs/ava/issues/3246">#3246</a></p>
</li>
<li>
<p><a
href="https://nodejs.org/api/util.html#utiltypesisnativeerrorvalue">Only
native errors</a> are now considered errors by the
<code>t.throws()</code> and <code>t.throwsAsync()</code> assertions. <a
href="Object.create(https://github.com/avajs/ava/blob/HEAD/Error.prototype)"><code>Object.create(https://github.com/avajs/ava/blob/HEAD/Error.prototype)</code>
is <strong>not</strong> a native error</a>. <a
href="https://redirect.github.com/avajs/ava/issues/3229">#3229</a></p>
</li>
<li>
<p>Changes to modules loaded through the <code>require</code>
configuration <a
href="https://redirect.github.com/avajs/ava/issues/3184">#3184</a>:</p>
<ul>
<li>If such modules export a default function, this function is now
invoked.</li>
<li>Local files are loaded through <code>@ava/typescript</code> if
necessary.</li>
</ul>
</li>
</ul>
<h2>Improvements</h2>
<h3>Rewritten watcher</h3>
<p>The watcher has been rewritten. It’s now built on <a
href="https://nodejs.org/api/fs.html#fswatchfilename-options-listener"><code>fs.watch()</code></a>
in recursive mode.</p>
<p><a href="https://github.com/vercel/nft"><code>@vercel/nft</code></a>
is used to perform static dependency analysis, supporting ESM and CJS
imports for JavaScript &amp; TypeScript source files. This is a huge
improvement over the previous runtime tracking of CJS imports, which did
not support ESM.</p>
<p>Integration with <a
href="https://github.com/avajs/typescript"><code>@ava/typescript</code></a>
has been improved. The watcher can now detect a change to a TypeScript
source file, then wait for the corresponding build output to change
before re-running tests.</p>
<p>The ignoredByWatcher configuration has moved to the watchMode object,
under the ignoreChanges key.</p>
<p>See <a
href="https://redirect.github.com/avajs/ava/issues/3218">#3218</a> and
<a
href="https://redirect.github.com/avajs/ava/issues/3257">#3257</a>.</p>
<h3>Failed assertions now throw</h3>
<p>Assertions now throw a <code>TestFailure</code> error when they fail.
This error is not exported or documented and should not be used or
thrown manually. You cannot catch this error in order to recover from a
failure, use <code>t.try()</code> instead.</p>
<p>All assertions except for <code>t.throws()</code> and
<code>t.throwsAsync()</code> now return <code>true</code> when they
pass. This is useful for some of the assertions in TypeScript where they
can be used as a type guard.</p>
<p>Committing a failed <code>t.try()</code> result now also throws.</p>
<p>See <a
href="https://redirect.github.com/avajs/ava/issues/3246">#3246</a>.</p>
<h3><code>t.throws()</code> and <code>t.throwsAsync()</code> can now
expect any error</h3>
<p>By default, the thrown error (or rejection reason) must be a native
error. You can change the assertion to expect any kind of error by
setting <code>any: true</code> in the expectation object:</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5975b602b7"><code>5975b60</code></a>
6.0.1</li>
<li><a
href="32f282fc21"><code>32f282f</code></a>
Ensure watch mode works outside of its integration tests</li>
<li><a
href="cf7a2886bf"><code>cf7a288</code></a>
6.0.0</li>
<li><a
href="af5684dff5"><code>af5684d</code></a>
Don't force-exit after tests have completed</li>
<li><a
href="88e433376a"><code>88e4333</code></a>
Update dependencies &amp; other minor tweaks</li>
<li><a
href="cac1d1fe64"><code>cac1d1f</code></a>
Tweak README</li>
<li><a
href="0492d32863"><code>0492d32</code></a>
Fix external assertions tests for Node.js 21</li>
<li><a
href="adbfcde981"><code>adbfcde</code></a>
Experimentally expose internal events for custom reporters</li>
<li><a
href="6790d50202"><code>6790d50</code></a>
Update memoize dependency</li>
<li><a
href="e07179bf4a"><code>e07179b</code></a>
Remove ability to select AVA 5 watcher</li>
<li>Additional commits viewable in <a
href="https://github.com/avajs/ava/compare/v5.3.1...v6.0.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `esbuild` from 0.19.8 to 0.19.11
<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.11</h2>
<ul>
<li>
<p>Fix TypeScript-specific class transform edge case (<a
href="https://redirect.github.com/evanw/esbuild/issues/3559">#3559</a>)</p>
<p>The previous release introduced an optimization that avoided
transforming <code>super()</code> in the class constructor for
TypeScript code compiled with <code>useDefineForClassFields</code> set
to <code>false</code> if all class instance fields have no initializers.
The rationale was that in this case, all class instance fields are
omitted in the output so no changes to the constructor are needed.
However, if all of this is the case <em>and</em> there are
<code>#private</code> instance fields with initializers, those private
instance field initializers were still being moved into the constructor.
This was problematic because they were being inserted before the call to
<code>super()</code> (since <code>super()</code> is now no longer
transformed in that case). This release introduces an additional
optimization that avoids moving the private instance field initializers
into the constructor in this edge case, which generates smaller code,
matches the TypeScript compiler's output more closely, and avoids this
bug:</p>
<pre lang="ts"><code>// Original code
class Foo extends Bar {
  #private = 1;
  public: any;
  constructor() {
    super();
  }
}
<p>// Old output (with esbuild v0.19.9)
class Foo extends Bar {
constructor() {
super();
this.#private = 1;
}
#private;
}</p>
<p>// Old output (with esbuild v0.19.10)
class Foo extends Bar {
constructor() {
this.#private = 1;
super();
}
#private;
}</p>
<p>// New output
class Foo extends Bar {
#private = 1;
constructor() {
super();
}
}
</code></pre></p>
</li>
<li>
<p>Minifier: allow reording a primitive past a side-effect (<a
href="https://redirect.github.com/evanw/esbuild/issues/3568">#3568</a>)</p>
<p>The minifier previously allowed reordering a side-effect past a
primitive, but didn't handle the case of reordering a primitive past a
side-effect. This additional case is now handled:</p>
<pre lang="js"><code>// Original code
function f() {
  let x = false;
</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.19.11</h2>
<ul>
<li>
<p>Fix TypeScript-specific class transform edge case (<a
href="https://redirect.github.com/evanw/esbuild/issues/3559">#3559</a>)</p>
<p>The previous release introduced an optimization that avoided
transforming <code>super()</code> in the class constructor for
TypeScript code compiled with <code>useDefineForClassFields</code> set
to <code>false</code> if all class instance fields have no initializers.
The rationale was that in this case, all class instance fields are
omitted in the output so no changes to the constructor are needed.
However, if all of this is the case <em>and</em> there are
<code>#private</code> instance fields with initializers, those private
instance field initializers were still being moved into the constructor.
This was problematic because they were being inserted before the call to
<code>super()</code> (since <code>super()</code> is now no longer
transformed in that case). This release introduces an additional
optimization that avoids moving the private instance field initializers
into the constructor in this edge case, which generates smaller code,
matches the TypeScript compiler's output more closely, and avoids this
bug:</p>
<pre lang="ts"><code>// Original code
class Foo extends Bar {
  #private = 1;
  public: any;
  constructor() {
    super();
  }
}
<p>// Old output (with esbuild v0.19.9)
class Foo extends Bar {
constructor() {
super();
this.#private = 1;
}
#private;
}</p>
<p>// Old output (with esbuild v0.19.10)
class Foo extends Bar {
constructor() {
this.#private = 1;
super();
}
#private;
}</p>
<p>// New output
class Foo extends Bar {
#private = 1;
constructor() {
super();
}
}
</code></pre></p>
</li>
<li>
<p>Minifier: allow reording a primitive past a side-effect (<a
href="https://redirect.github.com/evanw/esbuild/issues/3568">#3568</a>)</p>
<p>The minifier previously allowed reordering a side-effect past a
primitive, but didn't handle the case of reordering a primitive past a
side-effect. This additional case is now handled:</p>
<pre lang="js"><code>// Original code
function f() {
</code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6ee82255bd"><code>6ee8225</code></a>
publish 0.19.11 to npm</li>
<li><a
href="f8ae3af32f"><code>f8ae3af</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3561">#3561</a>:
treeshaking of known <code>Symbol</code> instances</li>
<li><a
href="0811058e16"><code>0811058</code></a>
switch define data to flags</li>
<li><a
href="f5f8ff895c"><code>f5f8ff8</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3568">#3568</a>:
can reorder primitive past side-effect</li>
<li><a
href="914f6080c7"><code>914f608</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3558">#3558</a>:
put the <code>stop()</code> api call back</li>
<li><a
href="2aa166b623"><code>2aa166b</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3559">#3559</a>:
fix recent class transform regression</li>
<li><a
href="55e1127a49"><code>55e1127</code></a>
publish 0.19.10 to npm</li>
<li><a
href="d968af29c3"><code>d968af2</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3511">#3511</a>:
<code>@__NO_SIDE_EFFECTS__</code> with templates</li>
<li><a
href="00c4ebeb91"><code>00c4ebe</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3546">#3546</a>:
don't transform <code>require</code> glob imports</li>
<li><a
href="e1b7050aa0"><code>e1b7050</code></a>
fix <a
href="https://redirect.github.com/evanw/esbuild/issues/3319">#3319</a>:
missing symbol usage in glob transform</li>
<li>Additional commits viewable in <a
href="https://github.com/evanw/esbuild/compare/v0.19.8...v0.19.11">compare
view</a></li>
</ul>
</details>
<br />

Updates `open-cli` from 7.2.0 to 8.0.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/sindresorhus/open-cli/releases">open-cli's
releases</a>.</em></p>
<blockquote>
<h2>v8.0.0</h2>
<h3>Breaking</h3>
<ul>
<li>Require Node.js 18  bb32fe9</li>
</ul>
<p><a
href="https://github.com/sindresorhus/open-cli/compare/v7.2.0...v8.0.0">https://github.com/sindresorhus/open-cli/compare/v7.2.0...v8.0.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9550e18064"><code>9550e18</code></a>
8.0.0</li>
<li><a
href="bb32fe985d"><code>bb32fe9</code></a>
Require Node.js 18</li>
<li>See full diff in <a
href="https://github.com/sindresorhus/open-cli/compare/v7.2.0...v8.0.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `undici` from 5.28.2 to 6.2.1
<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>v6.2.1</h2>
<h2>What's Changed</h2>
<ul>
<li>perf: use tree by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2528">nodejs/undici#2528</a></li>
<li>chore: reduce dependencies by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2533">nodejs/undici#2533</a></li>
<li>Remove timers in agent.js by <a
href="https://github.com/mcollina"><code>@​mcollina</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2536">nodejs/undici#2536</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.2.0...v6.2.1">https://github.com/nodejs/undici/compare/v6.2.0...v6.2.1</a></p>
<h2>v6.2.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Remove FinalizationRegistry from Agent by <a
href="https://github.com/mcollina"><code>@​mcollina</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2530">nodejs/undici#2530</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.1.0...v6.2.0">https://github.com/nodejs/undici/compare/v6.1.0...v6.2.0</a></p>
<h2>v6.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: more sensible stack trace from dump error by <a
href="https://github.com/ronag"><code>@​ronag</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2503">nodejs/undici#2503</a></li>
<li>refactor: remove some node compat by <a
href="https://github.com/ronag"><code>@​ronag</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2502">nodejs/undici#2502</a></li>
<li>refactor: version cleanup by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2507">nodejs/undici#2507</a></li>
<li>perf(fetch): Improve fetch of detaurl by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2479">nodejs/undici#2479</a></li>
<li>feat: expose parseHeader by <a
href="https://github.com/ronag"><code>@​ronag</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2511">nodejs/undici#2511</a></li>
<li>perf(fetch): optimize call <code>dispatch</code> by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2493">nodejs/undici#2493</a></li>
<li>perf(util/parseHeaders): If the header name is buffer by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2501">nodejs/undici#2501</a></li>
<li>perf: twice faster method check by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2495">nodejs/undici#2495</a></li>
<li>refactor: remove Error.captureStackTrace by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2509">nodejs/undici#2509</a></li>
<li>perf: Improve processHeader by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2513">nodejs/undici#2513</a></li>
<li>perf: reduce <code>String#toLowerCase</code> call by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2516">nodejs/undici#2516</a></li>
<li>perf: optimize consumeEnd by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2510">nodejs/undici#2510</a></li>
<li>perf: reduce tst built time by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2517">nodejs/undici#2517</a></li>
<li>feat: allow customization of build environment by <a
href="https://github.com/khardix"><code>@​khardix</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2403">nodejs/undici#2403</a></li>
<li>fix: clear cache by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2519">nodejs/undici#2519</a></li>
<li>feat: Add resource timing entries for connection, request and
response by <a href="https://github.com/ToshB"><code>@​ToshB</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/2481">nodejs/undici#2481</a></li>
<li>Call fg.unregister() after a dispatcher is done, adds UNDICI_NO_FG
to… by <a href="https://github.com/mcollina"><code>@​mcollina</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/2527">nodejs/undici#2527</a></li>
<li>feat: expose headerNameToString by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2525">nodejs/undici#2525</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/khardix"><code>@​khardix</code></a> made
their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/2403">nodejs/undici#2403</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.0.1...v6.1.0">https://github.com/nodejs/undici/compare/v6.0.1...v6.1.0</a></p>
<h2>v6.0.1</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: stream error timings by <a
href="https://github.com/ronag"><code>@​ronag</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/2497">nodejs/undici#2497</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.0.0...v6.0.1">https://github.com/nodejs/undici/compare/v6.0.0...v6.0.1</a></p>
<h2>v6.0.0</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f51f917061"><code>f51f917</code></a>
Bumped v6.2.1</li>
<li><a
href="36e81319eb"><code>36e8131</code></a>
Remove timers in agent.js (<a
href="https://redirect.github.com/nodejs/undici/issues/2536">#2536</a>)</li>
<li><a
href="5f4d435cbc"><code>5f4d435</code></a>
chore: reduce dependencies (<a
href="https://redirect.github.com/nodejs/undici/issues/2533">#2533</a>)</li>
<li><a
href="c5c6648a7d"><code>c5c6648</code></a>
perf: use tree (<a
href="https://redirect.github.com/nodejs/undici/issues/2528">#2528</a>)</li>
<li><a
href="0c4c450485"><code>0c4c450</code></a>
Bumped v6.2.0</li>
<li><a
href="59c2f3801c"><code>59c2f38</code></a>
Remove FinalizationRegistry from Agent (<a
href="https://redirect.github.com/nodejs/undici/issues/2530">#2530</a>)</li>
<li><a
href="250b89af0a"><code>250b89a</code></a>
Bumped v6.1.0</li>
<li><a
href="38f2226718"><code>38f2226</code></a>
feat: expose headerNameToString (<a
href="https://redirect.github.com/nodejs/undici/issues/2525">#2525</a>)</li>
<li><a
href="974a85e9d4"><code>974a85e</code></a>
Call fg.unregister() after a dispatcher is done, adds UNDICI_NO_FG to…
(<a
href="https://redirect.github.com/nodejs/undici/issues/2527">#2527</a>)</li>
<li><a
href="871baa74ec"><code>871baa7</code></a>
feat: Add resource timing entries for connection, request and response
(<a
href="https://redirect.github.com/nodejs/undici/issues/2481">#2481</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/nodejs/undici/compare/v5.28.2...v6.2.1">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 13:16:22 -08:00
20 changed files with 1498 additions and 1862 deletions

View File

@@ -15,7 +15,11 @@ In order to use this action, you need to:
### Create a token for the current repository ### Create a token for the current repository
```yaml ```yaml
on: [issues] name: Run tests on staging
on:
push:
branches:
- main
jobs: jobs:
hello-world: hello-world:
@@ -26,11 +30,10 @@ jobs:
with: with:
app-id: ${{ vars.APP_ID }} app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }} private-key: ${{ secrets.PRIVATE_KEY }}
- uses: peter-evans/create-or-update-comment@v3 github-api-url: "https://github.acme-inc.com/api/v3"
- uses: ./actions/staging-tests
with: with:
token: ${{ steps.app-token.outputs.token }} token: ${{ steps.app-token.outputs.token }}
issue-number: ${{ github.event.issue.number }}
body: "Hello, World!"
``` ```
### Use app token with `actions/checkout` ### Use app token with `actions/checkout`
@@ -146,7 +149,7 @@ jobs:
run: echo 'matrix=[{"owner":"owner1"},{"owner":"owner2","repos":["repo1"]}]' >>"$GITHUB_OUTPUT" run: echo 'matrix=[{"owner":"owner1"},{"owner":"owner2","repos":["repo1"]}]' >>"$GITHUB_OUTPUT"
use-matrix: use-matrix:
name: '@${{ matrix.owners-and-repos.owner }} installation' name: "@${{ matrix.owners-and-repos.owner }} installation"
needs: [set-matrix] needs: [set-matrix]
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
@@ -172,6 +175,12 @@ jobs:
MULTILINE_JSON_STRING: ${{ steps.get-installation-repositories.outputs.data }} MULTILINE_JSON_STRING: ${{ steps.get-installation-repositories.outputs.data }}
``` ```
### Run the workflow in a github.com repository against an organization in GitHub Enterprise Server
```yaml
on: [push]
```
## Inputs ## Inputs
### `app-id` ### `app-id`
@@ -197,6 +206,10 @@ jobs:
**Optional:** If truthy, the token will not be revoked when the current job is complete. **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 ## Outputs
### `token` ### `token`

View File

@@ -32,6 +32,11 @@ inputs:
description: "If truthy, the token will not be revoked when the current job is complete" description: "If truthy, the token will not be revoked when the current job is complete"
required: false required: false
deprecationMessage: "'skip_token_revoke' is deprecated and will be removed in a future version. Use 'skip-token-revoke' instead." deprecationMessage: "'skip_token_revoke' is deprecated and will be removed in a future version. Use 'skip-token-revoke' instead."
# Make GitHub API configurable to support non-GitHub Cloud use cases
# see https://github.com/actions/create-github-app-token/issues/77
github-api-url:
description: The URL of the GitHub REST API.
default: ${{ github.api_url }}
outputs: outputs:
token: token:
description: "GitHub installation access token" description: "GitHub installation access token"

513
dist/main.cjs vendored

File diff suppressed because it is too large Load Diff

279
dist/post.cjs vendored
View File

@@ -34,10 +34,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
// node_modules/@actions/core/lib/utils.js // node_modules/@actions/core/lib/utils.js
var require_utils = __commonJS({ var require_utils = __commonJS({
"node_modules/@actions/core/lib/utils.js"(exports) { "node_modules/@actions/core/lib/utils.js"(exports2) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.toCommandProperties = exports.toCommandValue = void 0; exports2.toCommandProperties = exports2.toCommandValue = void 0;
function toCommandValue(input) { function toCommandValue(input) {
if (input === null || input === void 0) { if (input === null || input === void 0) {
return ""; return "";
@@ -46,7 +46,7 @@ var require_utils = __commonJS({
} }
return JSON.stringify(input); return JSON.stringify(input);
} }
exports.toCommandValue = toCommandValue; exports2.toCommandValue = toCommandValue;
function toCommandProperties(annotationProperties) { function toCommandProperties(annotationProperties) {
if (!Object.keys(annotationProperties).length) { if (!Object.keys(annotationProperties).length) {
return {}; return {};
@@ -60,15 +60,15 @@ var require_utils = __commonJS({
endColumn: annotationProperties.endColumn endColumn: annotationProperties.endColumn
}; };
} }
exports.toCommandProperties = toCommandProperties; exports2.toCommandProperties = toCommandProperties;
} }
}); });
// node_modules/@actions/core/lib/command.js // node_modules/@actions/core/lib/command.js
var require_command = __commonJS({ var require_command = __commonJS({
"node_modules/@actions/core/lib/command.js"(exports) { "node_modules/@actions/core/lib/command.js"(exports2) {
"use strict"; "use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0) if (k2 === void 0)
k2 = k; k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { Object.defineProperty(o, k2, { enumerable: true, get: function() {
@@ -79,12 +79,12 @@ var require_command = __commonJS({
k2 = k; k2 = k;
o[k2] = m[k]; o[k2] = m[k];
}); });
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
} : function(o, v) { } : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = exports && exports.__importStar || function(mod) { var __importStar = exports2 && exports2.__importStar || function(mod) {
if (mod && mod.__esModule) if (mod && mod.__esModule)
return mod; return mod;
var result = {}; var result = {};
@@ -96,19 +96,19 @@ var require_command = __commonJS({
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.issue = exports.issueCommand = void 0; exports2.issue = exports2.issueCommand = void 0;
var os = __importStar(require("os")); var os = __importStar(require("os"));
var utils_1 = require_utils(); var utils_1 = require_utils();
function issueCommand(command, properties, message) { function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message); const cmd = new Command(command, properties, message);
process.stdout.write(cmd.toString() + os.EOL); process.stdout.write(cmd.toString() + os.EOL);
} }
exports.issueCommand = issueCommand; exports2.issueCommand = issueCommand;
function issue(name, message = "") { function issue(name, message = "") {
issueCommand(name, {}, message); issueCommand(name, {}, message);
} }
exports.issue = issue; exports2.issue = issue;
var CMD_STRING = "::"; var CMD_STRING = "::";
var Command = class { var Command = class {
constructor(command, properties, message) { constructor(command, properties, message) {
@@ -486,9 +486,9 @@ var init_esm_node = __esm({
// node_modules/@actions/core/lib/file-command.js // node_modules/@actions/core/lib/file-command.js
var require_file_command = __commonJS({ var require_file_command = __commonJS({
"node_modules/@actions/core/lib/file-command.js"(exports) { "node_modules/@actions/core/lib/file-command.js"(exports2) {
"use strict"; "use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0) if (k2 === void 0)
k2 = k; k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { Object.defineProperty(o, k2, { enumerable: true, get: function() {
@@ -499,12 +499,12 @@ var require_file_command = __commonJS({
k2 = k; k2 = k;
o[k2] = m[k]; o[k2] = m[k];
}); });
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
} : function(o, v) { } : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = exports && exports.__importStar || function(mod) { var __importStar = exports2 && exports2.__importStar || function(mod) {
if (mod && mod.__esModule) if (mod && mod.__esModule)
return mod; return mod;
var result = {}; var result = {};
@@ -516,8 +516,8 @@ var require_file_command = __commonJS({
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0;
var fs = __importStar(require("fs")); var fs = __importStar(require("fs"));
var os = __importStar(require("os")); var os = __importStar(require("os"));
var uuid_1 = (init_esm_node(), __toCommonJS(esm_node_exports)); var uuid_1 = (init_esm_node(), __toCommonJS(esm_node_exports));
@@ -534,7 +534,7 @@ var require_file_command = __commonJS({
encoding: "utf8" encoding: "utf8"
}); });
} }
exports.issueFileCommand = issueFileCommand; exports2.issueFileCommand = issueFileCommand;
function prepareKeyValueMessage(key, value) { function prepareKeyValueMessage(key, value) {
const delimiter = `ghadelimiter_${uuid_1.v4()}`; const delimiter = `ghadelimiter_${uuid_1.v4()}`;
const convertedValue = utils_1.toCommandValue(value); const convertedValue = utils_1.toCommandValue(value);
@@ -546,16 +546,16 @@ var require_file_command = __commonJS({
} }
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
} }
exports.prepareKeyValueMessage = prepareKeyValueMessage; exports2.prepareKeyValueMessage = prepareKeyValueMessage;
} }
}); });
// node_modules/@actions/http-client/lib/proxy.js // node_modules/@actions/http-client/lib/proxy.js
var require_proxy = __commonJS({ var require_proxy = __commonJS({
"node_modules/@actions/http-client/lib/proxy.js"(exports) { "node_modules/@actions/http-client/lib/proxy.js"(exports2) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.checkBypass = exports.getProxyUrl = void 0; exports2.checkBypass = exports2.getProxyUrl = void 0;
function getProxyUrl(reqUrl) { function getProxyUrl(reqUrl) {
const usingSsl = reqUrl.protocol === "https:"; const usingSsl = reqUrl.protocol === "https:";
if (checkBypass(reqUrl)) { if (checkBypass(reqUrl)) {
@@ -579,7 +579,7 @@ var require_proxy = __commonJS({
return void 0; return void 0;
} }
} }
exports.getProxyUrl = getProxyUrl; exports2.getProxyUrl = getProxyUrl;
function checkBypass(reqUrl) { function checkBypass(reqUrl) {
if (!reqUrl.hostname) { if (!reqUrl.hostname) {
return false; return false;
@@ -611,7 +611,7 @@ var require_proxy = __commonJS({
} }
return false; return false;
} }
exports.checkBypass = checkBypass; exports2.checkBypass = checkBypass;
function isLoopbackAddress(host) { function isLoopbackAddress(host) {
const hostLower = host.toLowerCase(); const hostLower = host.toLowerCase();
return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]");
@@ -621,7 +621,7 @@ var require_proxy = __commonJS({
// node_modules/tunnel/lib/tunnel.js // node_modules/tunnel/lib/tunnel.js
var require_tunnel = __commonJS({ var require_tunnel = __commonJS({
"node_modules/tunnel/lib/tunnel.js"(exports) { "node_modules/tunnel/lib/tunnel.js"(exports2) {
"use strict"; "use strict";
var net = require("net"); var net = require("net");
var tls = require("tls"); var tls = require("tls");
@@ -630,10 +630,10 @@ var require_tunnel = __commonJS({
var events = require("events"); var events = require("events");
var assert = require("assert"); var assert = require("assert");
var util = require("util"); var util = require("util");
exports.httpOverHttp = httpOverHttp; exports2.httpOverHttp = httpOverHttp;
exports.httpsOverHttp = httpsOverHttp; exports2.httpsOverHttp = httpsOverHttp;
exports.httpOverHttps = httpOverHttps; exports2.httpOverHttps = httpOverHttps;
exports.httpsOverHttps = httpsOverHttps; exports2.httpsOverHttps = httpsOverHttps;
function httpOverHttp(options) { function httpOverHttp(options) {
var agent = new TunnelingAgent(options); var agent = new TunnelingAgent(options);
agent.request = http.request; agent.request = http.request;
@@ -845,22 +845,22 @@ var require_tunnel = __commonJS({
debug = function() { debug = function() {
}; };
} }
exports.debug = debug; exports2.debug = debug;
} }
}); });
// node_modules/tunnel/index.js // node_modules/tunnel/index.js
var require_tunnel2 = __commonJS({ var require_tunnel2 = __commonJS({
"node_modules/tunnel/index.js"(exports, module2) { "node_modules/tunnel/index.js"(exports2, module2) {
module2.exports = require_tunnel(); module2.exports = require_tunnel();
} }
}); });
// node_modules/@actions/http-client/lib/index.js // node_modules/@actions/http-client/lib/index.js
var require_lib = __commonJS({ var require_lib = __commonJS({
"node_modules/@actions/http-client/lib/index.js"(exports) { "node_modules/@actions/http-client/lib/index.js"(exports2) {
"use strict"; "use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0) if (k2 === void 0)
k2 = k; k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { Object.defineProperty(o, k2, { enumerable: true, get: function() {
@@ -871,12 +871,12 @@ var require_lib = __commonJS({
k2 = k; k2 = k;
o[k2] = m[k]; o[k2] = m[k];
}); });
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
} : function(o, v) { } : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = exports && exports.__importStar || function(mod) { var __importStar = exports2 && exports2.__importStar || function(mod) {
if (mod && mod.__esModule) if (mod && mod.__esModule)
return mod; return mod;
var result = {}; var result = {};
@@ -888,7 +888,7 @@ var require_lib = __commonJS({
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
function adopt(value) { function adopt(value) {
return value instanceof P ? value : new P(function(resolve) { return value instanceof P ? value : new P(function(resolve) {
resolve(value); resolve(value);
@@ -915,8 +915,8 @@ var require_lib = __commonJS({
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0;
var http = __importStar(require("http")); var http = __importStar(require("http"));
var https = __importStar(require("https")); var https = __importStar(require("https"));
var pm = __importStar(require_proxy()); var pm = __importStar(require_proxy());
@@ -950,21 +950,21 @@ var require_lib = __commonJS({
HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway";
HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable";
HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout";
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); })(HttpCodes = exports2.HttpCodes || (exports2.HttpCodes = {}));
var Headers; var Headers;
(function(Headers2) { (function(Headers2) {
Headers2["Accept"] = "accept"; Headers2["Accept"] = "accept";
Headers2["ContentType"] = "content-type"; Headers2["ContentType"] = "content-type";
})(Headers = exports.Headers || (exports.Headers = {})); })(Headers = exports2.Headers || (exports2.Headers = {}));
var MediaTypes; var MediaTypes;
(function(MediaTypes2) { (function(MediaTypes2) {
MediaTypes2["ApplicationJson"] = "application/json"; MediaTypes2["ApplicationJson"] = "application/json";
})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); })(MediaTypes = exports2.MediaTypes || (exports2.MediaTypes = {}));
function getProxyUrl(serverUrl) { function getProxyUrl(serverUrl) {
const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
return proxyUrl ? proxyUrl.href : ""; return proxyUrl ? proxyUrl.href : "";
} }
exports.getProxyUrl = getProxyUrl; exports2.getProxyUrl = getProxyUrl;
var HttpRedirectCodes = [ var HttpRedirectCodes = [
HttpCodes.MovedPermanently, HttpCodes.MovedPermanently,
HttpCodes.ResourceMoved, HttpCodes.ResourceMoved,
@@ -988,7 +988,7 @@ var require_lib = __commonJS({
Object.setPrototypeOf(this, _HttpClientError.prototype); Object.setPrototypeOf(this, _HttpClientError.prototype);
} }
}; };
exports.HttpClientError = HttpClientError; exports2.HttpClientError = HttpClientError;
var HttpClientResponse = class { var HttpClientResponse = class {
constructor(message) { constructor(message) {
this.message = message; this.message = message;
@@ -1020,12 +1020,12 @@ var require_lib = __commonJS({
}); });
} }
}; };
exports.HttpClientResponse = HttpClientResponse; exports2.HttpClientResponse = HttpClientResponse;
function isHttps(requestUrl) { function isHttps(requestUrl) {
const parsedUrl = new URL(requestUrl); const parsedUrl = new URL(requestUrl);
return parsedUrl.protocol === "https:"; return parsedUrl.protocol === "https:";
} }
exports.isHttps = isHttps; exports2.isHttps = isHttps;
var HttpClient = class { var HttpClient = class {
constructor(userAgent, handlers, requestOptions) { constructor(userAgent, handlers, requestOptions) {
this._ignoreSslError = false; this._ignoreSslError = false;
@@ -1444,16 +1444,16 @@ var require_lib = __commonJS({
}); });
} }
}; };
exports.HttpClient = HttpClient; exports2.HttpClient = HttpClient;
var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
} }
}); });
// node_modules/@actions/http-client/lib/auth.js // node_modules/@actions/http-client/lib/auth.js
var require_auth = __commonJS({ var require_auth = __commonJS({
"node_modules/@actions/http-client/lib/auth.js"(exports) { "node_modules/@actions/http-client/lib/auth.js"(exports2) {
"use strict"; "use strict";
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
function adopt(value) { function adopt(value) {
return value instanceof P ? value : new P(function(resolve) { return value instanceof P ? value : new P(function(resolve) {
resolve(value); resolve(value);
@@ -1480,8 +1480,8 @@ var require_auth = __commonJS({
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0;
var BasicCredentialHandler = class { var BasicCredentialHandler = class {
constructor(username, password) { constructor(username, password) {
this.username = username; this.username = username;
@@ -1503,7 +1503,7 @@ var require_auth = __commonJS({
}); });
} }
}; };
exports.BasicCredentialHandler = BasicCredentialHandler; exports2.BasicCredentialHandler = BasicCredentialHandler;
var BearerCredentialHandler = class { var BearerCredentialHandler = class {
constructor(token) { constructor(token) {
this.token = token; this.token = token;
@@ -1526,7 +1526,7 @@ var require_auth = __commonJS({
}); });
} }
}; };
exports.BearerCredentialHandler = BearerCredentialHandler; exports2.BearerCredentialHandler = BearerCredentialHandler;
var PersonalAccessTokenCredentialHandler = class { var PersonalAccessTokenCredentialHandler = class {
constructor(token) { constructor(token) {
this.token = token; this.token = token;
@@ -1549,15 +1549,15 @@ var require_auth = __commonJS({
}); });
} }
}; };
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
} }
}); });
// node_modules/@actions/core/lib/oidc-utils.js // node_modules/@actions/core/lib/oidc-utils.js
var require_oidc_utils = __commonJS({ var require_oidc_utils = __commonJS({
"node_modules/@actions/core/lib/oidc-utils.js"(exports) { "node_modules/@actions/core/lib/oidc-utils.js"(exports2) {
"use strict"; "use strict";
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
function adopt(value) { function adopt(value) {
return value instanceof P ? value : new P(function(resolve) { return value instanceof P ? value : new P(function(resolve) {
resolve(value); resolve(value);
@@ -1584,8 +1584,8 @@ var require_oidc_utils = __commonJS({
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.OidcClient = void 0; exports2.OidcClient = void 0;
var http_client_1 = require_lib(); var http_client_1 = require_lib();
var auth_1 = require_auth(); var auth_1 = require_auth();
var core_1 = require_core(); var core_1 = require_core();
@@ -1647,15 +1647,15 @@ var require_oidc_utils = __commonJS({
}); });
} }
}; };
exports.OidcClient = OidcClient; exports2.OidcClient = OidcClient;
} }
}); });
// node_modules/@actions/core/lib/summary.js // node_modules/@actions/core/lib/summary.js
var require_summary = __commonJS({ var require_summary = __commonJS({
"node_modules/@actions/core/lib/summary.js"(exports) { "node_modules/@actions/core/lib/summary.js"(exports2) {
"use strict"; "use strict";
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
function adopt(value) { function adopt(value) {
return value instanceof P ? value : new P(function(resolve) { return value instanceof P ? value : new P(function(resolve) {
resolve(value); resolve(value);
@@ -1682,13 +1682,13 @@ var require_summary = __commonJS({
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; exports2.summary = exports2.markdownSummary = exports2.SUMMARY_DOCS_URL = exports2.SUMMARY_ENV_VAR = void 0;
var os_1 = require("os"); var os_1 = require("os");
var fs_1 = require("fs"); var fs_1 = require("fs");
var { access, appendFile, writeFile } = fs_1.promises; var { access, appendFile, writeFile } = fs_1.promises;
exports.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; exports2.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY";
exports.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; exports2.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";
var Summary = class { var Summary = class {
constructor() { constructor() {
this._buffer = ""; this._buffer = "";
@@ -1704,9 +1704,9 @@ var require_summary = __commonJS({
if (this._filePath) { if (this._filePath) {
return this._filePath; return this._filePath;
} }
const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; const pathFromEnv = process.env[exports2.SUMMARY_ENV_VAR];
if (!pathFromEnv) { if (!pathFromEnv) {
throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); throw new Error(`Unable to find environment variable for $${exports2.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
} }
try { try {
yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
@@ -1940,16 +1940,16 @@ var require_summary = __commonJS({
} }
}; };
var _summary = new Summary(); var _summary = new Summary();
exports.markdownSummary = _summary; exports2.markdownSummary = _summary;
exports.summary = _summary; exports2.summary = _summary;
} }
}); });
// node_modules/@actions/core/lib/path-utils.js // node_modules/@actions/core/lib/path-utils.js
var require_path_utils = __commonJS({ var require_path_utils = __commonJS({
"node_modules/@actions/core/lib/path-utils.js"(exports) { "node_modules/@actions/core/lib/path-utils.js"(exports2) {
"use strict"; "use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0) if (k2 === void 0)
k2 = k; k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { Object.defineProperty(o, k2, { enumerable: true, get: function() {
@@ -1960,12 +1960,12 @@ var require_path_utils = __commonJS({
k2 = k; k2 = k;
o[k2] = m[k]; o[k2] = m[k];
}); });
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
} : function(o, v) { } : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = exports && exports.__importStar || function(mod) { var __importStar = exports2 && exports2.__importStar || function(mod) {
if (mod && mod.__esModule) if (mod && mod.__esModule)
return mod; return mod;
var result = {}; var result = {};
@@ -1977,29 +1977,29 @@ var require_path_utils = __commonJS({
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0;
var path = __importStar(require("path")); var path = __importStar(require("path"));
function toPosixPath(pth) { function toPosixPath(pth) {
return pth.replace(/[\\]/g, "/"); return pth.replace(/[\\]/g, "/");
} }
exports.toPosixPath = toPosixPath; exports2.toPosixPath = toPosixPath;
function toWin32Path(pth) { function toWin32Path(pth) {
return pth.replace(/[/]/g, "\\"); return pth.replace(/[/]/g, "\\");
} }
exports.toWin32Path = toWin32Path; exports2.toWin32Path = toWin32Path;
function toPlatformPath(pth) { function toPlatformPath(pth) {
return pth.replace(/[/\\]/g, path.sep); return pth.replace(/[/\\]/g, path.sep);
} }
exports.toPlatformPath = toPlatformPath; exports2.toPlatformPath = toPlatformPath;
} }
}); });
// node_modules/@actions/core/lib/core.js // node_modules/@actions/core/lib/core.js
var require_core = __commonJS({ var require_core = __commonJS({
"node_modules/@actions/core/lib/core.js"(exports) { "node_modules/@actions/core/lib/core.js"(exports2) {
"use strict"; "use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0) if (k2 === void 0)
k2 = k; k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { Object.defineProperty(o, k2, { enumerable: true, get: function() {
@@ -2010,12 +2010,12 @@ var require_core = __commonJS({
k2 = k; k2 = k;
o[k2] = m[k]; o[k2] = m[k];
}); });
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
} : function(o, v) { } : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = exports && exports.__importStar || function(mod) { var __importStar = exports2 && exports2.__importStar || function(mod) {
if (mod && mod.__esModule) if (mod && mod.__esModule)
return mod; return mod;
var result = {}; var result = {};
@@ -2027,7 +2027,7 @@ var require_core = __commonJS({
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
function adopt(value) { function adopt(value) {
return value instanceof P ? value : new P(function(resolve) { return value instanceof P ? value : new P(function(resolve) {
resolve(value); resolve(value);
@@ -2054,8 +2054,8 @@ var require_core = __commonJS({
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; exports2.getIDToken = exports2.getState = exports2.saveState = exports2.group = exports2.endGroup = exports2.startGroup = exports2.info = exports2.notice = exports2.warning = exports2.error = exports2.debug = exports2.isDebug = exports2.setFailed = exports2.setCommandEcho = exports2.setOutput = exports2.getBooleanInput = exports2.getMultilineInput = exports2.getInput = exports2.addPath = exports2.setSecret = exports2.exportVariable = exports2.ExitCode = void 0;
var command_1 = require_command(); var command_1 = require_command();
var file_command_1 = require_file_command(); var file_command_1 = require_file_command();
var utils_1 = require_utils(); var utils_1 = require_utils();
@@ -2066,7 +2066,7 @@ var require_core = __commonJS({
(function(ExitCode2) { (function(ExitCode2) {
ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Success"] = 0] = "Success";
ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure";
})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); })(ExitCode = exports2.ExitCode || (exports2.ExitCode = {}));
function exportVariable(name, val) { function exportVariable(name, val) {
const convertedVal = utils_1.toCommandValue(val); const convertedVal = utils_1.toCommandValue(val);
process.env[name] = convertedVal; process.env[name] = convertedVal;
@@ -2076,11 +2076,11 @@ var require_core = __commonJS({
} }
command_1.issueCommand("set-env", { name }, convertedVal); command_1.issueCommand("set-env", { name }, convertedVal);
} }
exports.exportVariable = exportVariable; exports2.exportVariable = exportVariable;
function setSecret(secret) { function setSecret(secret) {
command_1.issueCommand("add-mask", {}, secret); command_1.issueCommand("add-mask", {}, secret);
} }
exports.setSecret = setSecret; exports2.setSecret = setSecret;
function addPath(inputPath) { function addPath(inputPath) {
const filePath = process.env["GITHUB_PATH"] || ""; const filePath = process.env["GITHUB_PATH"] || "";
if (filePath) { if (filePath) {
@@ -2090,7 +2090,7 @@ var require_core = __commonJS({
} }
process.env["PATH"] = `${inputPath}${path.delimiter}${process.env["PATH"]}`; process.env["PATH"] = `${inputPath}${path.delimiter}${process.env["PATH"]}`;
} }
exports.addPath = addPath; exports2.addPath = addPath;
function getInput(name, options) { function getInput(name, options) {
const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || "";
if (options && options.required && !val) { if (options && options.required && !val) {
@@ -2101,7 +2101,7 @@ var require_core = __commonJS({
} }
return val.trim(); return val.trim();
} }
exports.getInput = getInput; exports2.getInput = getInput;
function getMultilineInput(name, options) { function getMultilineInput(name, options) {
const inputs = getInput(name, options).split("\n").filter((x) => x !== ""); const inputs = getInput(name, options).split("\n").filter((x) => x !== "");
if (options && options.trimWhitespace === false) { if (options && options.trimWhitespace === false) {
@@ -2109,7 +2109,7 @@ var require_core = __commonJS({
} }
return inputs.map((input) => input.trim()); return inputs.map((input) => input.trim());
} }
exports.getMultilineInput = getMultilineInput; exports2.getMultilineInput = getMultilineInput;
function getBooleanInput(name, options) { function getBooleanInput(name, options) {
const trueValue = ["true", "True", "TRUE"]; const trueValue = ["true", "True", "TRUE"];
const falseValue = ["false", "False", "FALSE"]; const falseValue = ["false", "False", "FALSE"];
@@ -2121,7 +2121,7 @@ var require_core = __commonJS({
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
} }
exports.getBooleanInput = getBooleanInput; exports2.getBooleanInput = getBooleanInput;
function setOutput(name, value) { function setOutput(name, value) {
const filePath = process.env["GITHUB_OUTPUT"] || ""; const filePath = process.env["GITHUB_OUTPUT"] || "";
if (filePath) { if (filePath) {
@@ -2130,48 +2130,48 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
process.stdout.write(os.EOL); process.stdout.write(os.EOL);
command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value)); command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value));
} }
exports.setOutput = setOutput; exports2.setOutput = setOutput;
function setCommandEcho(enabled) { function setCommandEcho(enabled) {
command_1.issue("echo", enabled ? "on" : "off"); command_1.issue("echo", enabled ? "on" : "off");
} }
exports.setCommandEcho = setCommandEcho; exports2.setCommandEcho = setCommandEcho;
function setFailed(message) { function setFailed(message) {
process.exitCode = ExitCode.Failure; process.exitCode = ExitCode.Failure;
error(message); error(message);
} }
exports.setFailed = setFailed; exports2.setFailed = setFailed;
function isDebug() { function isDebug() {
return process.env["RUNNER_DEBUG"] === "1"; return process.env["RUNNER_DEBUG"] === "1";
} }
exports.isDebug = isDebug; exports2.isDebug = isDebug;
function debug(message) { function debug(message) {
command_1.issueCommand("debug", {}, message); command_1.issueCommand("debug", {}, message);
} }
exports.debug = debug; exports2.debug = debug;
function error(message, properties = {}) { function error(message, properties = {}) {
command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
} }
exports.error = error; exports2.error = error;
function warning(message, properties = {}) { function warning(message, properties = {}) {
command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
} }
exports.warning = warning; exports2.warning = warning;
function notice(message, properties = {}) { function notice(message, properties = {}) {
command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
} }
exports.notice = notice; exports2.notice = notice;
function info(message) { function info(message) {
process.stdout.write(message + os.EOL); process.stdout.write(message + os.EOL);
} }
exports.info = info; exports2.info = info;
function startGroup(name) { function startGroup(name) {
command_1.issue("group", name); command_1.issue("group", name);
} }
exports.startGroup = startGroup; exports2.startGroup = startGroup;
function endGroup() { function endGroup() {
command_1.issue("endgroup"); command_1.issue("endgroup");
} }
exports.endGroup = endGroup; exports2.endGroup = endGroup;
function group(name, fn) { function group(name, fn) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
startGroup(name); startGroup(name);
@@ -2184,7 +2184,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
return result; return result;
}); });
} }
exports.group = group; exports2.group = group;
function saveState(name, value) { function saveState(name, value) {
const filePath = process.env["GITHUB_STATE"] || ""; const filePath = process.env["GITHUB_STATE"] || "";
if (filePath) { if (filePath) {
@@ -2192,33 +2192,33 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
} }
command_1.issueCommand("save-state", { name }, utils_1.toCommandValue(value)); command_1.issueCommand("save-state", { name }, utils_1.toCommandValue(value));
} }
exports.saveState = saveState; exports2.saveState = saveState;
function getState(name) { function getState(name) {
return process.env[`STATE_${name}`] || ""; return process.env[`STATE_${name}`] || "";
} }
exports.getState = getState; exports2.getState = getState;
function getIDToken(aud) { function getIDToken(aud) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
return yield oidc_utils_1.OidcClient.getIDToken(aud); return yield oidc_utils_1.OidcClient.getIDToken(aud);
}); });
} }
exports.getIDToken = getIDToken; exports2.getIDToken = getIDToken;
var summary_1 = require_summary(); var summary_1 = require_summary();
Object.defineProperty(exports, "summary", { enumerable: true, get: function() { Object.defineProperty(exports2, "summary", { enumerable: true, get: function() {
return summary_1.summary; return summary_1.summary;
} }); } });
var summary_2 = require_summary(); var summary_2 = require_summary();
Object.defineProperty(exports, "markdownSummary", { enumerable: true, get: function() { Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() {
return summary_2.markdownSummary; return summary_2.markdownSummary;
} }); } });
var path_utils_1 = require_path_utils(); var path_utils_1 = require_path_utils();
Object.defineProperty(exports, "toPosixPath", { enumerable: true, get: function() { Object.defineProperty(exports2, "toPosixPath", { enumerable: true, get: function() {
return path_utils_1.toPosixPath; return path_utils_1.toPosixPath;
} }); } });
Object.defineProperty(exports, "toWin32Path", { enumerable: true, get: function() { Object.defineProperty(exports2, "toWin32Path", { enumerable: true, get: function() {
return path_utils_1.toWin32Path; return path_utils_1.toWin32Path;
} }); } });
Object.defineProperty(exports, "toPlatformPath", { enumerable: true, get: function() { Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() {
return path_utils_1.toPlatformPath; return path_utils_1.toPlatformPath;
} }); } });
} }
@@ -2226,9 +2226,9 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
// node_modules/universal-user-agent/dist-node/index.js // node_modules/universal-user-agent/dist-node/index.js
var require_dist_node = __commonJS({ var require_dist_node = __commonJS({
"node_modules/universal-user-agent/dist-node/index.js"(exports) { "node_modules/universal-user-agent/dist-node/index.js"(exports2) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
function getUserAgent() { function getUserAgent() {
if (typeof navigator === "object" && "userAgent" in navigator) { if (typeof navigator === "object" && "userAgent" in navigator) {
return navigator.userAgent; return navigator.userAgent;
@@ -2238,15 +2238,15 @@ var require_dist_node = __commonJS({
} }
return "<environment undetectable>"; return "<environment undetectable>";
} }
exports.getUserAgent = getUserAgent; exports2.getUserAgent = getUserAgent;
} }
}); });
// node_modules/is-plain-object/dist/is-plain-object.js // node_modules/is-plain-object/dist/is-plain-object.js
var require_is_plain_object = __commonJS({ var require_is_plain_object = __commonJS({
"node_modules/is-plain-object/dist/is-plain-object.js"(exports) { "node_modules/is-plain-object/dist/is-plain-object.js"(exports2) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
function isObject(o) { function isObject(o) {
return Object.prototype.toString.call(o) === "[object Object]"; return Object.prototype.toString.call(o) === "[object Object]";
} }
@@ -2265,13 +2265,13 @@ var require_is_plain_object = __commonJS({
} }
return true; return true;
} }
exports.isPlainObject = isPlainObject; exports2.isPlainObject = isPlainObject;
} }
}); });
// node_modules/@octokit/endpoint/dist-node/index.js // node_modules/@octokit/endpoint/dist-node/index.js
var require_dist_node2 = __commonJS({ var require_dist_node2 = __commonJS({
"node_modules/@octokit/endpoint/dist-node/index.js"(exports, module2) { "node_modules/@octokit/endpoint/dist-node/index.js"(exports2, module2) {
"use strict"; "use strict";
var __defProp2 = Object.defineProperty; var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -2599,9 +2599,9 @@ var require_dist_node2 = __commonJS({
// node_modules/deprecation/dist-node/index.js // node_modules/deprecation/dist-node/index.js
var require_dist_node3 = __commonJS({ var require_dist_node3 = __commonJS({
"node_modules/deprecation/dist-node/index.js"(exports) { "node_modules/deprecation/dist-node/index.js"(exports2) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports2, "__esModule", { value: true });
var Deprecation = class extends Error { var Deprecation = class extends Error {
constructor(message) { constructor(message) {
super(message); super(message);
@@ -2611,13 +2611,13 @@ var require_dist_node3 = __commonJS({
this.name = "Deprecation"; this.name = "Deprecation";
} }
}; };
exports.Deprecation = Deprecation; exports2.Deprecation = Deprecation;
} }
}); });
// node_modules/wrappy/wrappy.js // node_modules/wrappy/wrappy.js
var require_wrappy = __commonJS({ var require_wrappy = __commonJS({
"node_modules/wrappy/wrappy.js"(exports, module2) { "node_modules/wrappy/wrappy.js"(exports2, module2) {
module2.exports = wrappy; module2.exports = wrappy;
function wrappy(fn, cb) { function wrappy(fn, cb) {
if (fn && cb) if (fn && cb)
@@ -2648,7 +2648,7 @@ var require_wrappy = __commonJS({
// node_modules/once/once.js // node_modules/once/once.js
var require_once = __commonJS({ var require_once = __commonJS({
"node_modules/once/once.js"(exports, module2) { "node_modules/once/once.js"(exports2, module2) {
var wrappy = require_wrappy(); var wrappy = require_wrappy();
module2.exports = wrappy(once); module2.exports = wrappy(once);
module2.exports.strict = wrappy(onceStrict); module2.exports.strict = wrappy(onceStrict);
@@ -2693,7 +2693,7 @@ var require_once = __commonJS({
// node_modules/@octokit/request-error/dist-node/index.js // node_modules/@octokit/request-error/dist-node/index.js
var require_dist_node4 = __commonJS({ var require_dist_node4 = __commonJS({
"node_modules/@octokit/request-error/dist-node/index.js"(exports, module2) { "node_modules/@octokit/request-error/dist-node/index.js"(exports2, module2) {
"use strict"; "use strict";
var __create2 = Object.create; var __create2 = Object.create;
var __defProp2 = Object.defineProperty; var __defProp2 = Object.defineProperty;
@@ -2785,7 +2785,7 @@ var require_dist_node4 = __commonJS({
// node_modules/@octokit/request/dist-node/index.js // node_modules/@octokit/request/dist-node/index.js
var require_dist_node5 = __commonJS({ var require_dist_node5 = __commonJS({
"node_modules/@octokit/request/dist-node/index.js"(exports, module2) { "node_modules/@octokit/request/dist-node/index.js"(exports2, module2) {
"use strict"; "use strict";
var __defProp2 = Object.defineProperty; var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -3003,30 +3003,41 @@ async function post(core2, request2) {
core2.info("Token is not set"); core2.info("Token is not set");
return; return;
} }
const expiresAt = core2.getState("expiresAt");
if (expiresAt && tokenExpiresIn(expiresAt) < 0) {
core2.info("Token expired, skipping token revocation");
return;
}
try {
await request2("DELETE /installation/token", { await request2("DELETE /installation/token", {
headers: { headers: {
authorization: `token ${token}` authorization: `token ${token}`
} }
}); });
core2.info("Token revoked"); core2.info("Token revoked");
} catch (error) {
core2.warning(
`Token revocation failed: ${error.message}`
);
}
}
function tokenExpiresIn(expiresAt) {
const now = /* @__PURE__ */ new Date();
const expiresAtDate = new Date(expiresAt);
return Math.round((expiresAtDate.getTime() - now.getTime()) / 1e3);
} }
// lib/request.js // lib/request.js
var import_request = __toESM(require_dist_node5(), 1); var import_request = __toESM(require_dist_node5(), 1);
var request_default = import_request.request.defaults({ var request_default = import_request.request.defaults({
baseUrl: process.env["GITHUB_API_URL"],
headers: { headers: {
"user-agent": "actions/create-github-app-token" "user-agent": "actions/create-github-app-token"
} }
}); });
// post.js // post.js
post( var baseUrl = import_core.default.getInput("github-api-url").replace(/\/$/, "");
import_core.default, post(import_core.default, request_default.defaults({ baseUrl })).catch((error) => {
request_default.defaults({
baseUrl: process.env["GITHUB_API_URL"]
})
).catch((error) => {
console.error(error); console.error(error);
import_core.default.setFailed(error.message); import_core.default.setFailed(error.message);
}); });

View File

@@ -103,6 +103,7 @@ export async function main(
// Make token accessible to post function (so we can invalidate it) // Make token accessible to post function (so we can invalidate it)
if (!skipTokenRevoke) { if (!skipTokenRevoke) {
core.saveState("token", authentication.token); core.saveState("token", authentication.token);
core.setOutput("expiresAt", authentication.expiresAt);
} }
} }

View File

@@ -21,11 +21,31 @@ export async function post(core, request) {
return; return;
} }
const expiresAt = core.getState("expiresAt");
if (expiresAt && tokenExpiresIn(expiresAt) < 0) {
core.info("Token expired, skipping token revocation");
return;
}
try {
await request("DELETE /installation/token", { await request("DELETE /installation/token", {
headers: { headers: {
authorization: `token ${token}`, authorization: `token ${token}`,
}, },
}); });
core.info("Token revoked"); core.info("Token revoked");
} catch (error) {
core.warning(
`Token revocation failed: ${error.message}`)
}
}
/**
* @param {string} expiresAt
*/
function tokenExpiresIn(expiresAt) {
const now = new Date();
const expiresAtDate = new Date(expiresAt);
return Math.round((expiresAtDate.getTime() - now.getTime()) / 1000);
} }

View File

@@ -1,7 +1,6 @@
import { request } from "@octokit/request"; import { request } from "@octokit/request";
export default request.defaults({ export default request.defaults({
baseUrl: process.env["GITHUB_API_URL"],
headers: { headers: {
"user-agent": "actions/create-github-app-token", "user-agent": "actions/create-github-app-token",
}, },

View File

@@ -31,6 +31,8 @@ const skipTokenRevoke = Boolean(
core.getInput("skip-token-revoke") || core.getInput("skip_token_revoke") core.getInput("skip-token-revoke") || core.getInput("skip_token_revoke")
); );
const baseUrl = core.getInput("github-api-url").replace(/\/$/, "");
main( main(
appId, appId,
privateKey, privateKey,
@@ -38,9 +40,7 @@ main(
repositories, repositories,
core, core,
createAppAuth, createAppAuth,
request.defaults({ request.defaults({ baseUrl }),
baseUrl: process.env["GITHUB_API_URL"],
}),
skipTokenRevoke skipTokenRevoke
).catch((error) => { ).catch((error) => {
/* c8 ignore next 3 */ /* c8 ignore next 3 */

2258
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"name": "create-github-app-token", "name": "create-github-app-token",
"private": true, "private": true,
"type": "module", "type": "module",
"version": "1.6.2", "version": "1.7.0",
"description": "GitHub Action for creating a GitHub App Installation Access Token", "description": "GitHub Action for creating a GitHub App Installation Access Token",
"scripts": { "scripts": {
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0", "build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0",
@@ -13,19 +13,19 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.1", "@actions/core": "^1.10.1",
"@octokit/auth-app": "^6.0.1", "@octokit/auth-app": "^6.0.3",
"@octokit/request": "^8.1.6", "@octokit/request": "^8.1.6",
"p-retry": "^6.1.0" "p-retry": "^6.2.0"
}, },
"devDependencies": { "devDependencies": {
"@sinonjs/fake-timers": "^11.2.2", "@sinonjs/fake-timers": "^11.2.2",
"ava": "^5.3.1", "ava": "^6.0.1",
"c8": "^8.0.1", "c8": "^8.0.1",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"esbuild": "^0.19.8", "esbuild": "^0.19.11",
"execa": "^8.0.1", "execa": "^8.0.1",
"open-cli": "^7.2.0", "open-cli": "^8.0.0",
"undici": "^5.28.2", "undici": "^6.2.1",
"yaml": "^2.3.4" "yaml": "^2.3.4"
}, },
"release": { "release": {

View File

@@ -5,12 +5,9 @@ import core from "@actions/core";
import { post } from "./lib/post.js"; import { post } from "./lib/post.js";
import request from "./lib/request.js"; import request from "./lib/request.js";
post( const baseUrl = core.getInput("github-api-url").replace(/\/$/, "");
core,
request.defaults({ post(core, request.defaults({ baseUrl })).catch((error) => {
baseUrl: process.env["GITHUB_API_URL"],
})
).catch((error) => {
/* c8 ignore next 3 */ /* c8 ignore next 3 */
console.error(error); console.error(error);
core.setFailed(error.message); core.setFailed(error.message);

View File

@@ -0,0 +1,13 @@
import { test, DEFAULT_ENV } from "./main.js";
// Verify that main works with a custom GitHub API URL passed as `github-api-url` input
await test(
() => {
process.env.INPUT_OWNER = process.env.GITHUB_REPOSITORY_OWNER;
process.env.INPUT_REPOSITORIES = process.env.GITHUB_REPOSITORY;
},
{
...DEFAULT_ENV,
"INPUT_GITHUB-API-URL": "https://github.acme-inc.com/api/v3",
}
);

View File

@@ -2,10 +2,10 @@ import { test } from "./main.js";
// Verify `main` retry when the GitHub API returns a 500 error. // Verify `main` retry when the GitHub API returns a 500 error.
await test((mockPool) => { await test((mockPool) => {
process.env.INPUT_OWNER = 'actions' process.env.INPUT_OWNER = "actions";
process.env.INPUT_REPOSITORIES = 'failed-repo'; process.env.INPUT_REPOSITORIES = "failed-repo";
const owner = process.env.INPUT_OWNER const owner = process.env.INPUT_OWNER;
const repo = process.env.INPUT_REPOSITORIES const repo = process.env.INPUT_REPOSITORIES;
const mockInstallationId = "123456"; const mockInstallationId = "123456";
mockPool mockPool
@@ -18,7 +18,7 @@ await test((mockPool) => {
// Intentionally omitting the `authorization` header, since JWT creation is not idempotent. // Intentionally omitting the `authorization` header, since JWT creation is not idempotent.
}, },
}) })
.reply(500, 'GitHub API not available') .reply(500, "GitHub API not available");
mockPool mockPool
.intercept({ .intercept({
@@ -35,5 +35,4 @@ await test((mockPool) => {
{ id: mockInstallationId }, { id: mockInstallationId },
{ headers: { "content-type": "application/json" } } { headers: { "content-type": "application/json" } }
); );
}); });

View File

@@ -17,7 +17,7 @@ await test((mockPool) => {
// Intentionally omitting the `authorization` header, since JWT creation is not idempotent. // Intentionally omitting the `authorization` header, since JWT creation is not idempotent.
}, },
}) })
.reply(500, 'GitHub API not available') .reply(500, "GitHub API not available");
mockPool mockPool
.intercept({ .intercept({
path: `/orgs/${process.env.INPUT_OWNER}/installation`, path: `/orgs/${process.env.INPUT_OWNER}/installation`,

View File

@@ -2,14 +2,15 @@
// @ts-check // @ts-check
import { MockAgent, setGlobalDispatcher } from "undici"; import { MockAgent, setGlobalDispatcher } from "undici";
export async function test(cb = (_mockPool) => {}) { export const DEFAULT_ENV = {
// Set required environment variables and inputs GITHUB_REPOSITORY_OWNER: "actions",
process.env.GITHUB_REPOSITORY_OWNER = "actions"; GITHUB_REPOSITORY: "actions/create-github-app-token",
process.env.GITHUB_REPOSITORY = "actions/create-github-app-token";
// inputs are set as environment variables with the prefix INPUT_ // inputs are set as environment variables with the prefix INPUT_
// https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs // https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
process.env["INPUT_APP-ID"] = "123456"; "INPUT_GITHUB-API-URL": "https://api.github.com",
process.env["INPUT_PRIVATE-KEY"] = `-----BEGIN RSA PRIVATE KEY----- "INPUT_APP-ID": "123456",
// This key is invalidated. Its from https://github.com/octokit/auth-app.js/issues/465#issuecomment-1564998327.
"INPUT_PRIVATE-KEY": `-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA280nfuUM9w00Ib9E2rvZJ6Qu3Ua3IqR34ZlK53vn/Iobn2EL MIIEowIBAAKCAQEA280nfuUM9w00Ib9E2rvZJ6Qu3Ua3IqR34ZlK53vn/Iobn2EL
Z9puc5Q/nFBU15NKwHyQNb+OG2hTCkjd1Xi9XPzEOH1r42YQmTGq8YCkUSkk6KZA Z9puc5Q/nFBU15NKwHyQNb+OG2hTCkjd1Xi9XPzEOH1r42YQmTGq8YCkUSkk6KZA
5dnhLwN9pFquT9fQgrf4r1D5GJj3rqvj8JDr1sBmunArqY5u4gziSrIohcjLIZV0 5dnhLwN9pFquT9fQgrf4r1D5GJj3rqvj8JDr1sBmunArqY5u4gziSrIohcjLIZV0
@@ -35,27 +36,33 @@ r4J2gqb0xTDfq7gLMNrIXc2QQM4gKbnJp60JQM3p9NmH8huavBZGvSvNzTwXyGG3
so0tiQKBgGQXZaxaXhYUcxYHuCkQ3V4Vsj3ezlM92xXlP32SGFm3KgFhYy9kATxw so0tiQKBgGQXZaxaXhYUcxYHuCkQ3V4Vsj3ezlM92xXlP32SGFm3KgFhYy9kATxw
Cax1ytZzvlrKLQyQFVK1COs2rHt7W4cJ7op7C8zXfsigXCiejnS664oAuX8sQZID Cax1ytZzvlrKLQyQFVK1COs2rHt7W4cJ7op7C8zXfsigXCiejnS664oAuX8sQZID
x3WQZRiXlWejSMUAHuMwXrhGlltF3lw83+xAjnqsVp75kGS6OH61 x3WQZRiXlWejSMUAHuMwXrhGlltF3lw83+xAjnqsVp75kGS6OH61
-----END RSA PRIVATE KEY-----`; // This key is invalidated. Its from https://github.com/octokit/auth-app.js/issues/465#issuecomment-1564998327. -----END RSA PRIVATE KEY-----`,
};
export async function test(cb = (_mockPool) => {}, env = DEFAULT_ENV) {
for (const [key, value] of Object.entries(env)) {
process.env[key] = value;
}
// Set up mocking // Set up mocking
const baseUrl = new URL(env["INPUT_GITHUB-API-URL"]);
const basePath = baseUrl.pathname === '/' ? '' : baseUrl.pathname;
const mockAgent = new MockAgent(); const mockAgent = new MockAgent();
mockAgent.disableNetConnect(); mockAgent.disableNetConnect();
setGlobalDispatcher(mockAgent); setGlobalDispatcher(mockAgent);
const mockPool = mockAgent.get("https://api.github.com"); const mockPool = mockAgent.get(baseUrl.origin);
// Calling `auth({ type: "app" })` to obtain a JWT doesnt make network requests, so no need to intercept. // Calling `auth({ type: "app" })` to obtain a JWT doesnt make network requests, so no need to intercept.
// Mock installation id request // Mock installation id request
const mockInstallationId = "123456"; const mockInstallationId = "123456";
const owner = process.env.INPUT_OWNER ?? process.env.GITHUB_REPOSITORY_OWNER; const owner = env.INPUT_OWNER ?? env.GITHUB_REPOSITORY_OWNER;
const repo = encodeURIComponent( const repo = encodeURIComponent(
(process.env.INPUT_REPOSITORIES ?? process.env.GITHUB_REPOSITORY).split( (env.INPUT_REPOSITORIES ?? env.GITHUB_REPOSITORY).split(",")[0]
","
)[0]
); );
mockPool mockPool
.intercept({ .intercept({
path: `/repos/${owner}/${repo}/installation`, path: `${basePath}/repos/${owner}/${repo}/installation`,
method: "GET", method: "GET",
headers: { headers: {
accept: "application/vnd.github.v3+json", accept: "application/vnd.github.v3+json",
@@ -72,9 +79,10 @@ x3WQZRiXlWejSMUAHuMwXrhGlltF3lw83+xAjnqsVp75kGS6OH61
// Mock installation access token request // Mock installation access token request
const mockInstallationAccessToken = const mockInstallationAccessToken =
"ghs_16C7e42F292c6912E7710c838347Ae178B4a"; // This token is invalidated. Its from https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app. "ghs_16C7e42F292c6912E7710c838347Ae178B4a"; // This token is invalidated. Its from https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app.
const mockExpiresAt = "2016-07-11T22:14:10Z";
mockPool mockPool
.intercept({ .intercept({
path: `/app/installations/${mockInstallationId}/access_tokens`, path: `${basePath}/app/installations/${mockInstallationId}/access_tokens`,
method: "POST", method: "POST",
headers: { headers: {
accept: "application/vnd.github.v3+json", accept: "application/vnd.github.v3+json",
@@ -84,7 +92,7 @@ x3WQZRiXlWejSMUAHuMwXrhGlltF3lw83+xAjnqsVp75kGS6OH61
}) })
.reply( .reply(
201, 201,
{ token: mockInstallationAccessToken }, { token: mockInstallationAccessToken, expires_at: mockExpiresAt },
{ headers: { "content-type": "application/json" } } { headers: { "content-type": "application/json" } }
); );

View File

@@ -0,0 +1,34 @@
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";
// inputs are set as environment variables with the prefix INPUT_
// https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
process.env["INPUT_GITHUB-API-URL"] = "https://api.github.com";
// 1 hour in the future, not expired
process.env.STATE_expiresAt = new Date(
Date.now() + 1000 * 60 * 60
).toISOString();
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(401);
await import("../post.js");

View File

@@ -0,0 +1,28 @@
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";
// 1 hour in the past, expired
process.env.STATE_expiresAt = new Date(Date.now() - 1000 * 60 * 60).toISOString();
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");

View File

@@ -4,6 +4,13 @@ import { MockAgent, setGlobalDispatcher } from "undici";
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions // 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"; process.env.STATE_token = "secret123";
// inputs are set as environment variables with the prefix INPUT_
// https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
process.env["INPUT_GITHUB-API-URL"] = "https://api.github.com";
// 1 hour in the future, not expired
process.env.STATE_expiresAt = new Date(Date.now() + 1000 * 60 * 60).toISOString();
const mockAgent = new MockAgent(); const mockAgent = new MockAgent();
setGlobalDispatcher(mockAgent); setGlobalDispatcher(mockAgent);

View File

@@ -16,6 +16,22 @@ Generated by [AVA](https://avajs.dev).
private_key — 'private_key' is deprecated and will be removed in a future version. Use 'private-key' instead.␊ private_key — 'private_key' is deprecated and will be removed in a future version. Use 'private-key' instead.␊
skip_token_revoke — 'skip_token_revoke' is deprecated and will be removed in a future version. Use 'skip-token-revoke' instead.` skip_token_revoke — 'skip_token_revoke' is deprecated and will be removed in a future version. Use 'skip-token-revoke' instead.`
## main-custom-github-api-url.test.js
> stderr
''
> stdout
`owner and repositories set, creating token for repositories "actions/create-github-app-token" owned by "actions"␊
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
## main-missing-app-id.test.js ## main-missing-app-id.test.js
> stderr > stderr
@@ -69,7 +85,9 @@ Generated by [AVA](https://avajs.dev).
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a` ::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-repo-set-to-many.test.js ## main-token-get-owner-set-repo-set-to-many.test.js
@@ -83,7 +101,9 @@ Generated by [AVA](https://avajs.dev).
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a` ::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-repo-set-to-one.test.js ## main-token-get-owner-set-repo-set-to-one.test.js
@@ -97,7 +117,9 @@ Generated by [AVA](https://avajs.dev).
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a` ::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-to-org-repo-unset.test.js ## main-token-get-owner-set-to-org-repo-unset.test.js
@@ -111,7 +133,9 @@ Generated by [AVA](https://avajs.dev).
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a` ::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-to-user-fail-response.test.js ## main-token-get-owner-set-to-user-fail-response.test.js
@@ -126,7 +150,9 @@ Generated by [AVA](https://avajs.dev).
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a` ::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-to-user-repo-unset.test.js ## main-token-get-owner-set-to-user-repo-unset.test.js
@@ -140,7 +166,9 @@ Generated by [AVA](https://avajs.dev).
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a` ::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-unset-repo-set.test.js ## main-token-get-owner-unset-repo-set.test.js
@@ -154,7 +182,9 @@ Generated by [AVA](https://avajs.dev).
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a` ::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-unset-repo-unset.test.js ## main-token-get-owner-unset-repo-unset.test.js
@@ -168,7 +198,29 @@ Generated by [AVA](https://avajs.dev).
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊ ::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a` ::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a
::set-output name=expiresAt::2016-07-11T22:14:10Z`
## post-revoke-token-fail-response.test.js
> stderr
''
> stdout
'::warning::Token revocation failed: '
## post-token-expired.test.js
> stderr
''
> stdout
'Token expired, skipping token revocation'
## post-token-set.test.js ## post-token-set.test.js

Binary file not shown.