Compare commits

...

8 Commits

Author SHA1 Message Date
semantic-release-bot 31c86eb3b3 build(release): 1.10.3 [skip ci]
## [1.10.3](https://github.com/actions/create-github-app-token/compare/v1.10.2...v1.10.3) (2024-07-01)

### Bug Fixes

* **deps:** bump undici from 6.18.2 to 6.19.2 in the production-dependencies group ([#149](https://github.com/actions/create-github-app-token/issues/149)) ([cc82279](https://github.com/actions/create-github-app-token/commit/cc82279e84540c5543078cedc5af4fcfab0a96bb)), closes [#3337](https://github.com/actions/create-github-app-token/issues/3337) [nodejs/undici#3338](https://github.com/nodejs/undici/issues/3338) [nodejs/undici#3340](https://github.com/nodejs/undici/issues/3340) [nodejs/undici#3332](https://github.com/nodejs/undici/issues/3332) [nodejs/undici#3335](https://github.com/nodejs/undici/issues/3335) [nodejs/undici#3305](https://github.com/nodejs/undici/issues/3305) [nodejs/undici#3303](https://github.com/nodejs/undici/issues/3303) [nodejs/undici#3304](https://github.com/nodejs/undici/issues/3304) [nodejs/undici#3306](https://github.com/nodejs/undici/issues/3306) [nodejs/undici#3309](https://github.com/nodejs/undici/issues/3309) [nodejs/undici#3313](https://github.com/nodejs/undici/issues/3313) [nodejs/undici#3311](https://github.com/nodejs/undici/issues/3311) [nodejs/undici#3107](https://github.com/nodejs/undici/issues/3107) [nodejs/undici#3302](https://github.com/nodejs/undici/issues/3302) [nodejs/undici#3320](https://github.com/nodejs/undici/issues/3320) [nodejs/undici#3321](https://github.com/nodejs/undici/issues/3321) [nodejs/undici#3316](https://github.com/nodejs/undici/issues/3316) [nodejs/undici#3318](https://github.com/nodejs/undici/issues/3318) [nodejs/undici#3326](https://github.com/nodejs/undici/issues/3326) [nodejs/undici#3324](https://github.com/nodejs/undici/issues/3324) [nodejs/undici#3325](https://github.com/nodejs/undici/issues/3325) [nodejs/undici#3316](https://github.com/nodejs/undici/issues/3316) [nodejs/undici#3318](https://github.com/nodejs/undici/issues/3318) [#3342](https://github.com/actions/create-github-app-token/issues/3342) [#3332](https://github.com/actions/create-github-app-token/issues/3332) [#3340](https://github.com/actions/create-github-app-token/issues/3340) [#3337](https://github.com/actions/create-github-app-token/issues/3337) [#3338](https://github.com/actions/create-github-app-token/issues/3338) [#3336](https://github.com/actions/create-github-app-token/issues/3336) [#3335](https://github.com/actions/create-github-app-token/issues/3335) [#3325](https://github.com/actions/create-github-app-token/issues/3325) [#3324](https://github.com/actions/create-github-app-token/issues/3324) [#3326](https://github.com/actions/create-github-app-token/issues/3326)
2024-07-01 13:15:08 +00:00
dependabot[bot] cc82279e84 fix(deps): bump undici from 6.18.2 to 6.19.2 in the production-dependencies group (#149)
Bumps the production-dependencies group with 1 update:
[undici](https://github.com/nodejs/undici).

Updates `undici` from 6.18.2 to 6.19.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nodejs/undici/releases">undici's
releases</a>.</em></p>
<blockquote>
<h2>v6.19.2</h2>
<h2>What's Changed</h2>
<ul>
<li>fix <a
href="https://redirect.github.com/nodejs/undici/issues/3337">#3337</a>
by <a href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3338">nodejs/undici#3338</a></li>
<li>build: use <code>husky</code> as <code>husky install</code> is
deprecated by <a
href="https://github.com/jazelly"><code>@​jazelly</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3340">nodejs/undici#3340</a></li>
<li>fix: interceptors.d.ts has no default export by <a
href="https://github.com/Uzlopak"><code>@​Uzlopak</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3332">nodejs/undici#3332</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.19.1...v6.19.2">https://github.com/nodejs/undici/compare/v6.19.1...v6.19.2</a></p>
<h2>v6.19.1</h2>
<h2>What's Changed</h2>
<ul>
<li>don't append empty origin by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3335">nodejs/undici#3335</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.19.0...v6.19.1">https://github.com/nodejs/undici/compare/v6.19.0...v6.19.1</a></p>
<h2>v6.19.0</h2>
<h2>What's Changed</h2>
<ul>
<li>build(deps): bump ossf/scorecard-action from 2.3.1 to 2.3.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3305">nodejs/undici#3305</a></li>
<li>build(deps): bump codecov/codecov-action from 4.3.1 to 4.4.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3303">nodejs/undici#3303</a></li>
<li>build(deps): bump step-security/harden-runner from 2.7.1 to 2.8.0 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://redirect.github.com/nodejs/undici/pull/3304">nodejs/undici#3304</a></li>
<li>build(deps): bump github/codeql-action from 3.25.3 to 3.25.7 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3306">nodejs/undici#3306</a></li>
<li>build(deps): bump node from <code>9e8f45f</code> to
<code>dd7e693</code> in /build by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3309">nodejs/undici#3309</a></li>
<li>build(deps): bump node from <code>dd7e693</code> to
<code>e6d4495</code> in /build by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3313">nodejs/undici#3313</a></li>
<li>remove websocket experimental warning by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3311">nodejs/undici#3311</a></li>
<li>perf: optimization of request instantiation by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3107">nodejs/undici#3107</a></li>
<li>perf: convert object to params by <a
href="https://github.com/DarkGL"><code>@​DarkGL</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3302">nodejs/undici#3302</a></li>
<li>build(deps-dev): bump borp from 0.14.0 to 0.15.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3320">nodejs/undici#3320</a></li>
<li>build(deps-dev): bump c8 from 9.1.0 to 10.0.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3321">nodejs/undici#3321</a></li>
<li>fix: add missing error classes to types by <a
href="https://github.com/maxbeatty"><code>@​maxbeatty</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3316">nodejs/undici#3316</a></li>
<li>export interceptor to type def file by <a
href="https://github.com/jakecastelli"><code>@​jakecastelli</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3318">nodejs/undici#3318</a></li>
<li>build(deps): bump node from <code>e6d4495</code> to
<code>075a5cc</code> in /build by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3326">nodejs/undici#3326</a></li>
<li>doc: clearify the behaviour of <code>bodyTimeout</code> in the
request by <a
href="https://github.com/jakecastelli"><code>@​jakecastelli</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3324">nodejs/undici#3324</a></li>
<li>feature: support pre-shared sessions by <a
href="https://github.com/tastypackets"><code>@​tastypackets</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3325">nodejs/undici#3325</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/maxbeatty"><code>@​maxbeatty</code></a>
made their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/3316">nodejs/undici#3316</a></li>
<li><a
href="https://github.com/jakecastelli"><code>@​jakecastelli</code></a>
made their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/3318">nodejs/undici#3318</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.18.2...v6.19.0">https://github.com/nodejs/undici/compare/v6.18.2...v6.19.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/nodejs/undici/commit/532b7b28827afe52ed7b43cbb210ac8425516c28"><code>532b7b2</code></a>
Bumped v6.19.2 (<a
href="https://redirect.github.com/nodejs/undici/issues/3342">#3342</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/a7441d8aaa44f9eec111a23a5df238d77b150c3a"><code>a7441d8</code></a>
fix: interceptors.d.ts has no default export (<a
href="https://redirect.github.com/nodejs/undici/issues/3332">#3332</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/5dadb95f10cebf5f82050a8174d515d5abac9732"><code>5dadb95</code></a>
build: use <code>husky</code> as <code>husky install</code> is
deprecated (<a
href="https://redirect.github.com/nodejs/undici/issues/3340">#3340</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/035524e71756f1f6e2f9886f3c7227394bdb5363"><code>035524e</code></a>
fix <a
href="https://redirect.github.com/nodejs/undici/issues/3337">#3337</a>
(<a
href="https://redirect.github.com/nodejs/undici/issues/3338">#3338</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/f6b9b442b02d8ab81b06ea0473e1c22bc8ddc254"><code>f6b9b44</code></a>
Bumped v6.19.1 (<a
href="https://redirect.github.com/nodejs/undici/issues/3336">#3336</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/1573f693db99d30a1ee13f2704f04181e88960c4"><code>1573f69</code></a>
don't append empty origin (<a
href="https://redirect.github.com/nodejs/undici/issues/3335">#3335</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/981fb3d72a4393f77c9f28e3ea2f77dc4cf6e9ad"><code>981fb3d</code></a>
Bumped v6.19.0</li>
<li><a
href="https://github.com/nodejs/undici/commit/39869b29966ac68157f5cbd27f3cf65cd2ab763d"><code>39869b2</code></a>
feature: support pre-shared sessions (<a
href="https://redirect.github.com/nodejs/undici/issues/3325">#3325</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/7f54a24a4a573088937530708be91586160d2d83"><code>7f54a24</code></a>
doc: clearify the behaviour of <code>bodyTimeout</code> in the request
(<a
href="https://redirect.github.com/nodejs/undici/issues/3324">#3324</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/9785b15cbd7831c4501e76c749fa3a6873042e6d"><code>9785b15</code></a>
build(deps): bump node from <code>e6d4495</code> to <code>075a5cc</code>
in /build (<a
href="https://redirect.github.com/nodejs/undici/issues/3326">#3326</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/nodejs/undici/compare/v6.18.2...v6.19.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=undici&package-manager=npm_and_yarn&previous-version=6.18.2&new-version=6.19.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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-07-01 06:14:36 -07:00
Anuraag (Rag) Agrawal 74cd7f68cb docs(README): fix committer string example and add git config example (#145) 2024-06-28 07:51:24 -07:00
semantic-release-bot ad38cffc07 build(release): 1.10.2 [skip ci]
## [1.10.2](https://github.com/actions/create-github-app-token/compare/v1.10.1...v1.10.2) (2024-06-26)

### Bug Fixes

* do not revoke token if already expired ([#147](https://github.com/actions/create-github-app-token/issues/147)) ([66a7045](https://github.com/actions/create-github-app-token/commit/66a70456860bafc79e37635eea77b8b2a929f6c8)), closes [#140](https://github.com/actions/create-github-app-token/issues/140) [#95](https://github.com/actions/create-github-app-token/issues/95)
2024-06-26 01:11:30 +00:00
Wechuli 66a7045686 fix: do not revoke token if already expired (#147)
Closes #140 

The pull request at #95 introduced changes to avoid revoking expired
tokens by saving the `expiresAt` value in the state. The change,
however, used `core.setOutput` instead of `core.setState` meaning the
value is not saved in the state but rather available in the output.

```javascript
if (!skipTokenRevoke) {
    core.saveState("token", authentication.token);
    core.setOutput("expiresAt", authentication.expiresAt);
  }
```
This means that when we use the value downstream, it evaluates to an
empty string and the following code block is never run:

```javascript
 const expiresAt = core.getState("expiresAt"); 
 if (expiresAt && tokenExpiresIn(expiresAt) < 0) { 
   core.info("Token expired, skipping token revocation"); 
   return; 
 } 
```
This is a tiny PR to correct that typo.
2024-06-25 18:10:54 -07:00
dependabot[bot] d2eeb384df build(deps-dev): bump braces from 3.0.2 to 3.0.3 (#146)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to
3.0.3.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/micromatch/braces/commit/74b2db2938fad48a2ea54a9c8bf27a37a62c350d"><code>74b2db2</code></a>
3.0.3</li>
<li><a
href="https://github.com/micromatch/braces/commit/88f1429a0f47e1dd3813de35211fc97ffda27f9e"><code>88f1429</code></a>
update eslint. lint, fix unit tests.</li>
<li><a
href="https://github.com/micromatch/braces/commit/415d660c3002d1ab7e63dbf490c9851da80596ff"><code>415d660</code></a>
Snyk js braces 6838727 (<a
href="https://redirect.github.com/micromatch/braces/issues/40">#40</a>)</li>
<li><a
href="https://github.com/micromatch/braces/commit/190510f79db1adf21d92798b0bb6fccc1f72c9d6"><code>190510f</code></a>
fix tests, skip 1 test in test/braces.expand</li>
<li><a
href="https://github.com/micromatch/braces/commit/716eb9f12d820b145a831ad678618731927e8856"><code>716eb9f</code></a>
readme bump</li>
<li><a
href="https://github.com/micromatch/braces/commit/a5851e57f45c3431a94d83fc565754bc10f5bbc3"><code>a5851e5</code></a>
Merge pull request <a
href="https://redirect.github.com/micromatch/braces/issues/37">#37</a>
from coderaiser/fix/vulnerability</li>
<li><a
href="https://github.com/micromatch/braces/commit/2092bd1fb108d2c59bd62e243b70ad98db961538"><code>2092bd1</code></a>
feature: braces: add maxSymbols (<a
href="https://github.com/micromatch/braces/issues/">https://github.com/micromatch/braces/issues/</a>...</li>
<li><a
href="https://github.com/micromatch/braces/commit/9f5b4cf47329351bcb64287223ffb6ecc9a5e6d3"><code>9f5b4cf</code></a>
fix: vulnerability (<a
href="https://security.snyk.io/vuln/SNYK-JS-BRACES-6838727">https://security.snyk.io/vuln/SNYK-JS-BRACES-6838727</a>)</li>
<li><a
href="https://github.com/micromatch/braces/commit/98414f9f1fabe021736e26836d8306d5de747e0d"><code>98414f9</code></a>
remove funding file</li>
<li><a
href="https://github.com/micromatch/braces/commit/665ab5d561c017a38ba7aafd92cc6655b91d8c14"><code>665ab5d</code></a>
update keepEscaping doc (<a
href="https://redirect.github.com/micromatch/braces/issues/27">#27</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/micromatch/braces/compare/3.0.2...3.0.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=braces&package-manager=npm_and_yarn&previous-version=3.0.2&new-version=3.0.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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 this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/actions/create-github-app-token/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 21:06:17 -07:00
Gregor Martynus 0fd38177ed docs(README): add note about expiration (#141)
addresses https://github.com/actions/create-github-app-token/issues/121#issuecomment-2043214796

Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
2024-06-11 20:56:57 -07:00
Gregor Martynus b3be847492 docs(README): Create a git committer string for an app installation (#142)
closes #137
2024-06-11 10:16:50 -07:00
8 changed files with 303 additions and 281 deletions
+61
View File
@@ -12,6 +12,9 @@ In order to use this action, you need to:
2. [Store the App's ID in your repository environment variables](https://docs.github.com/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows) (example: `APP_ID`)
3. [Store the App's private key in your repository secrets](https://docs.github.com/actions/security-guides/encrypted-secrets?tool=webui#creating-encrypted-secrets-for-a-repository) (example: `PRIVATE_KEY`)
> [!IMPORTANT]
> An installation access token expires after 1 hour. Please [see this comment](https://github.com/actions/create-github-app-token/issues/121#issuecomment-2043214796) for alternative approaches if you have long-running processes.
### Create a token for the current repository
```yaml
@@ -61,6 +64,64 @@ jobs:
github_token: ${{ steps.app-token.outputs.token }}
```
### Create a git committer string for an app installation
```yaml
on: [pull_request]
jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Retrieve GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.generate-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- id: committer
run: echo "string=${{steps.app-token.outputs.app-slug}}[bot] <${{steps.get-user-id.outputs.user-id}}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT"
- run: echo "committer string is ${{steps.committer.outputs.string}}"
```
### Configure git CLI for an app's bot user
```yaml
on: [pull_request]
jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Retrieve GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.generate-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- run: |
git config --global user.name '${{steps.app-token.outputs.app-slug}}[bot]'
git config --global user.email '${{steps.get-user-id.outputs.user-id}}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
# git commands like commit work using the bot user
- run: |
git add .
git commit -m "Auto-generated changes"
git push
```
The `<BOT USER ID>` is the numeric user ID of the app's bot user, which can be found under `https://api.github.com/users/<app-slug>%5Bbot%5D`.
For example, we can check at `https://api.github.com/users/dependabot%5Bbot%5D` to see the user ID of dependabot is 49699333.
### Create a token for all repositories in the current owner's installation
```yaml
+109 -124
View File
@@ -20172,6 +20172,27 @@ var require_util8 = __commonJS({
}
var kEnumerableProperty = /* @__PURE__ */ Object.create(null);
kEnumerableProperty.enumerable = true;
var normalizedMethodRecordsBase = {
delete: "DELETE",
DELETE: "DELETE",
get: "GET",
GET: "GET",
head: "HEAD",
HEAD: "HEAD",
options: "OPTIONS",
OPTIONS: "OPTIONS",
post: "POST",
POST: "POST",
put: "PUT",
PUT: "PUT"
};
var normalizedMethodRecords = {
...normalizedMethodRecordsBase,
patch: "patch",
PATCH: "PATCH"
};
Object.setPrototypeOf(normalizedMethodRecordsBase, null);
Object.setPrototypeOf(normalizedMethodRecords, null);
module2.exports = {
kEnumerableProperty,
nop,
@@ -20210,6 +20231,8 @@ var require_util8 = __commonJS({
isValidHeaderValue,
isTokenCharCode,
parseRangeHeader,
normalizedMethodRecordsBase,
normalizedMethodRecords,
isValidPort,
isHttpOrHttpsPrefixed,
nodeMajor,
@@ -20425,7 +20448,8 @@ var require_request3 = __commonJS({
isBlobLike,
buildURL,
validateHandler,
getServerName
getServerName,
normalizedMethodRecords
} = require_util8();
var { channels } = require_diagnostics();
var { headerNameLowerCasedRecord } = require_constants6();
@@ -20452,12 +20476,12 @@ var require_request3 = __commonJS({
throw new InvalidArgumentError("path must be a string");
} else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") {
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
} else if (invalidPathRegex.exec(path) !== null) {
} else if (invalidPathRegex.test(path)) {
throw new InvalidArgumentError("invalid request path");
}
if (typeof method !== "string") {
throw new InvalidArgumentError("method must be a string");
} else if (!isValidHTTPToken(method)) {
} else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) {
throw new InvalidArgumentError("invalid request method");
}
if (upgrade && typeof upgrade !== "string") {
@@ -21002,7 +21026,7 @@ var require_connect2 = __commonJS({
}
};
}
function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero");
}
@@ -21018,7 +21042,7 @@ var require_connect2 = __commonJS({
}
servername = servername || options.servername || util.getServerName(host) || null;
const sessionKey = servername || hostname;
const session = sessionCache.get(sessionKey) || null;
const session = customSession || sessionCache.get(sessionKey) || null;
assert(sessionKey);
socket = tls.connect({
highWaterMark: 16384,
@@ -22536,7 +22560,7 @@ var require_util9 = __commonJS({
var { getGlobalOrigin } = require_global3();
var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url();
var { performance: performance2 } = require("node:perf_hooks");
var { isBlobLike, ReadableStreamFrom, isValidHTTPToken } = require_util8();
var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util8();
var assert = require("node:assert");
var { isUint8Array } = require("node:util/types");
var { webidl } = require_webidl2();
@@ -22643,7 +22667,7 @@ var require_util9 = __commonJS({
}
function appendRequestOriginHeader(request2) {
let serializedOrigin = request2.origin;
if (serializedOrigin === "client") {
if (serializedOrigin === "client" || serializedOrigin === void 0) {
return;
}
if (request2.responseTainting === "cors" || request2.mode === "websocket") {
@@ -22924,29 +22948,8 @@ var require_util9 = __commonJS({
function isCancelled(fetchParams) {
return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated";
}
var normalizeMethodRecordBase = {
delete: "DELETE",
DELETE: "DELETE",
get: "GET",
GET: "GET",
head: "HEAD",
HEAD: "HEAD",
options: "OPTIONS",
OPTIONS: "OPTIONS",
post: "POST",
POST: "POST",
put: "PUT",
PUT: "PUT"
};
var normalizeMethodRecord = {
...normalizeMethodRecordBase,
patch: "patch",
PATCH: "PATCH"
};
Object.setPrototypeOf(normalizeMethodRecordBase, null);
Object.setPrototypeOf(normalizeMethodRecord, null);
function normalizeMethod(method) {
return normalizeMethodRecordBase[method.toLowerCase()] ?? method;
return normalizedMethodRecordsBase[method.toLowerCase()] ?? method;
}
function serializeJavascriptValueToJSONString(value) {
const result = JSON.stringify(value);
@@ -23083,7 +23086,7 @@ var require_util9 = __commonJS({
}
});
}
async function fullyReadBody(body, processBody, processBodyError, shouldClone) {
async function fullyReadBody(body, processBody, processBodyError) {
const successSteps = processBody;
const errorSteps = processBodyError;
let reader;
@@ -23094,7 +23097,7 @@ var require_util9 = __commonJS({
return;
}
try {
successSteps(await readAllBytes(reader, shouldClone));
successSteps(await readAllBytes(reader));
} catch (e) {
errorSteps(e);
}
@@ -23117,19 +23120,12 @@ var require_util9 = __commonJS({
assert(!invalidIsomorphicEncodeValueRegex.test(input));
return input;
}
async function readAllBytes(reader, shouldClone) {
async function readAllBytes(reader) {
const bytes = [];
let byteLength = 0;
while (true) {
const { done, value: chunk } = await reader.read();
if (done) {
if (bytes.length === 1) {
const { buffer, byteOffset, byteLength: byteLength2 } = bytes[0];
if (shouldClone === false) {
return Buffer.from(buffer, byteOffset, byteLength2);
}
return Buffer.from(buffer.slice(byteOffset, byteOffset + byteLength2), 0, byteLength2);
}
return Buffer.concat(bytes, byteLength);
}
if (!isUint8Array(chunk)) {
@@ -23392,7 +23388,6 @@ var require_util9 = __commonJS({
urlHasHttpsScheme,
urlIsHttpHttpsScheme,
readAllBytes,
normalizeMethodRecord,
simpleRangeHeaderValue,
buildContentRange,
parseMetadata,
@@ -24064,18 +24059,18 @@ Content-Type: ${value.type || "application/octet-stream"}\r
mimeType = serializeAMimeType(mimeType);
}
return new Blob2([bytes], { type: mimeType });
}, instance, false);
}, instance);
},
arrayBuffer() {
return consumeBody(this, (bytes) => {
return bytes.buffer;
}, instance, true);
return new Uint8Array(bytes).buffer;
}, instance);
},
text() {
return consumeBody(this, utf8DecodeBytes, instance, false);
return consumeBody(this, utf8DecodeBytes, instance);
},
json() {
return consumeBody(this, parseJSONFromBytes, instance, false);
return consumeBody(this, parseJSONFromBytes, instance);
},
formData() {
return consumeBody(this, (value) => {
@@ -24104,12 +24099,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r
throw new TypeError(
'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
);
}, instance, false);
}, instance);
},
bytes() {
return consumeBody(this, (bytes) => {
return new Uint8Array(bytes.buffer, 0, bytes.byteLength);
}, instance, true);
return new Uint8Array(bytes);
}, instance);
}
};
return methods;
@@ -24117,7 +24112,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
function mixinBody(prototype) {
Object.assign(prototype.prototype, bodyMixinMethods(prototype));
}
async function consumeBody(object, convertBytesToJSValue, instance, shouldClone) {
async function consumeBody(object, convertBytesToJSValue, instance) {
webidl.brandCheck(object, instance);
if (bodyUnusable(object[kState].body)) {
throw new TypeError("Body is unusable: Body has already been read");
@@ -24136,7 +24131,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
successSteps(Buffer.allocUnsafe(0));
return promise.promise;
}
await fullyReadBody(object[kState].body, successSteps, errorSteps, shouldClone);
await fullyReadBody(object[kState].body, successSteps, errorSteps);
return promise.promise;
}
function bodyUnusable(body) {
@@ -24889,25 +24884,25 @@ upgrade: ${upgrade}\r
channels.sendHeaders.publish({ request: request2, headers: header, socket });
}
if (!body || bodyLength === 0) {
writeBuffer({ abort, body: null, client, request: request2, socket, contentLength, header, expectsPayload });
writeBuffer(abort, null, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isBuffer(body)) {
writeBuffer({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload });
writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isBlobLike(body)) {
if (typeof body.stream === "function") {
writeIterable({ abort, body: body.stream(), client, request: request2, socket, contentLength, header, expectsPayload });
writeIterable(abort, body.stream(), client, request2, socket, contentLength, header, expectsPayload);
} else {
writeBlob({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload });
writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload);
}
} else if (util.isStream(body)) {
writeStream({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload });
writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isIterable(body)) {
writeIterable({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload });
writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else {
assert(false);
}
return true;
}
function writeStream({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) {
function writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
let finished = false;
const writer = new AsyncWriter({ abort, socket, request: request2, contentLength, client, expectsPayload, header });
@@ -24976,7 +24971,7 @@ upgrade: ${upgrade}\r
setImmediate(onClose);
}
}
function writeBuffer({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) {
function writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
try {
if (!body) {
if (contentLength === 0) {
@@ -25007,7 +25002,7 @@ upgrade: ${upgrade}\r
abort(err);
}
}
async function writeBlob({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) {
async function writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength === body.size, "blob body must have content length");
try {
if (contentLength != null && contentLength !== body.size) {
@@ -25030,7 +25025,7 @@ upgrade: ${upgrade}\r
abort(err);
}
}
async function writeIterable({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) {
async function writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
let callback = null;
function onDrain() {
@@ -25493,81 +25488,79 @@ var require_client_h2 = __commonJS({
return true;
function writeBodyH2() {
if (!body || contentLength === 0) {
writeBuffer({
writeBuffer(
abort,
stream,
null,
client,
request: request2,
request2,
client[kSocket],
contentLength,
expectsPayload,
h2stream: stream,
body: null,
socket: client[kSocket]
});
expectsPayload
);
} else if (util.isBuffer(body)) {
writeBuffer({
writeBuffer(
abort,
client,
request: request2,
contentLength,
stream,
body,
expectsPayload,
h2stream: stream,
socket: client[kSocket]
});
client,
request2,
client[kSocket],
contentLength,
expectsPayload
);
} else if (util.isBlobLike(body)) {
if (typeof body.stream === "function") {
writeIterable({
writeIterable(
abort,
stream,
body.stream(),
client,
request: request2,
request2,
client[kSocket],
contentLength,
expectsPayload,
h2stream: stream,
body: body.stream(),
socket: client[kSocket]
});
expectsPayload
);
} else {
writeBlob({
writeBlob(
abort,
stream,
body,
client,
request: request2,
request2,
client[kSocket],
contentLength,
expectsPayload,
h2stream: stream,
socket: client[kSocket]
});
expectsPayload
);
}
} else if (util.isStream(body)) {
writeStream({
writeStream(
abort,
client[kSocket],
expectsPayload,
stream,
body,
client,
request: request2,
contentLength,
expectsPayload,
socket: client[kSocket],
h2stream: stream,
header: ""
});
request2,
contentLength
);
} else if (util.isIterable(body)) {
writeIterable({
writeIterable(
abort,
stream,
body,
client,
request: request2,
request2,
client[kSocket],
contentLength,
expectsPayload,
header: "",
h2stream: stream,
socket: client[kSocket]
});
expectsPayload
);
} else {
assert(false);
}
}
}
function writeBuffer({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) {
function writeBuffer(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
try {
if (body != null && util.isBuffer(body)) {
assert(contentLength === body.byteLength, "buffer body must have content length");
@@ -25586,7 +25579,7 @@ var require_client_h2 = __commonJS({
abort(error);
}
}
function writeStream({ abort, socket, expectsPayload, h2stream, body, client, request: request2, contentLength }) {
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) {
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
const pipe = pipeline(
body,
@@ -25610,7 +25603,7 @@ var require_client_h2 = __commonJS({
request2.onBodySent(chunk);
}
}
async function writeBlob({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) {
async function writeBlob(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
assert(contentLength === body.size, "blob body must have content length");
try {
if (contentLength != null && contentLength !== body.size) {
@@ -25631,7 +25624,7 @@ var require_client_h2 = __commonJS({
abort(err);
}
}
async function writeIterable({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) {
async function writeIterable(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
let callback = null;
function onDrain() {
@@ -27376,7 +27369,7 @@ var require_retry_handler = __commonJS({
this.abort(
new RequestRetryError("Content-Range mismatch", statusCode, {
headers,
count: this.retryCount
data: { count: this.retryCount }
})
);
return false;
@@ -27385,7 +27378,7 @@ var require_retry_handler = __commonJS({
this.abort(
new RequestRetryError("ETag mismatch", statusCode, {
headers,
count: this.retryCount
data: { count: this.retryCount }
})
);
return false;
@@ -30609,9 +30602,7 @@ var require_request4 = __commonJS({
var {
isValidHTTPToken,
sameOrigin,
normalizeMethod,
environmentSettingsObject,
normalizeMethodRecord
environmentSettingsObject
} = require_util9();
var {
forbiddenMethodsSet,
@@ -30623,7 +30614,7 @@ var require_request4 = __commonJS({
requestCache,
requestDuplex
} = require_constants8();
var { kEnumerableProperty } = util;
var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util;
var { kHeaders, kSignal, kState, kDispatcher } = require_symbols7();
var { webidl } = require_webidl2();
var { URLSerializer } = require_data_url();
@@ -30820,17 +30811,18 @@ var require_request4 = __commonJS({
}
if (init.method !== void 0) {
let method = init.method;
const mayBeNormalized = normalizeMethodRecord[method];
const mayBeNormalized = normalizedMethodRecords[method];
if (mayBeNormalized !== void 0) {
request2.method = mayBeNormalized;
} else {
if (!isValidHTTPToken(method)) {
throw new TypeError(`'${method}' is not a valid HTTP method.`);
}
if (forbiddenMethodsSet.has(method.toUpperCase())) {
const upperCase = method.toUpperCase();
if (forbiddenMethodsSet.has(upperCase)) {
throw new TypeError(`'${method}' HTTP method is unsupported.`);
}
method = normalizeMethod(method);
method = normalizedMethodRecordsBase[upperCase] ?? method;
request2.method = method;
}
if (!patchMethodWarning && request2.method === "patch") {
@@ -35546,7 +35538,6 @@ var require_websocket2 = __commonJS({
var { types } = require("node:util");
var { ErrorEvent, CloseEvent } = require_events2();
var { SendQueue } = require_sender();
var experimentalWarned = false;
var WebSocket = class _WebSocket extends EventTarget {
#events = {
open: null,
@@ -35567,12 +35558,6 @@ var require_websocket2 = __commonJS({
super();
const prefix = "WebSocket constructor";
webidl.argumentLengthCheck(arguments, 1, prefix);
if (!experimentalWarned) {
experimentalWarned = true;
process.emitWarning("WebSockets are experimental, expect them to change at any time.", {
code: "UNDICI-WS"
});
}
const options = webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"](protocols, prefix, "options");
url = webidl.converters.USVString(url, prefix, "url");
protocols = options.protocols;
@@ -39753,7 +39738,7 @@ async function main(appId2, privateKey2, owner2, repositories2, core3, createApp
core3.setOutput("app-slug", appSlug);
if (!skipTokenRevoke2) {
core3.saveState("token", authentication.token);
core3.setOutput("expiresAt", authentication.expiresAt);
core3.saveState("expiresAt", authentication.expiresAt);
}
}
async function getTokenFromOwner(request2, auth5, parsedOwner) {
+108 -123
View File
@@ -19943,6 +19943,27 @@ var require_util8 = __commonJS({
}
var kEnumerableProperty = /* @__PURE__ */ Object.create(null);
kEnumerableProperty.enumerable = true;
var normalizedMethodRecordsBase = {
delete: "DELETE",
DELETE: "DELETE",
get: "GET",
GET: "GET",
head: "HEAD",
HEAD: "HEAD",
options: "OPTIONS",
OPTIONS: "OPTIONS",
post: "POST",
POST: "POST",
put: "PUT",
PUT: "PUT"
};
var normalizedMethodRecords = {
...normalizedMethodRecordsBase,
patch: "patch",
PATCH: "PATCH"
};
Object.setPrototypeOf(normalizedMethodRecordsBase, null);
Object.setPrototypeOf(normalizedMethodRecords, null);
module2.exports = {
kEnumerableProperty,
nop,
@@ -19981,6 +20002,8 @@ var require_util8 = __commonJS({
isValidHeaderValue,
isTokenCharCode,
parseRangeHeader,
normalizedMethodRecordsBase,
normalizedMethodRecords,
isValidPort,
isHttpOrHttpsPrefixed,
nodeMajor,
@@ -20196,7 +20219,8 @@ var require_request3 = __commonJS({
isBlobLike,
buildURL,
validateHandler,
getServerName
getServerName,
normalizedMethodRecords
} = require_util8();
var { channels } = require_diagnostics();
var { headerNameLowerCasedRecord } = require_constants6();
@@ -20223,12 +20247,12 @@ var require_request3 = __commonJS({
throw new InvalidArgumentError("path must be a string");
} else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") {
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
} else if (invalidPathRegex.exec(path) !== null) {
} else if (invalidPathRegex.test(path)) {
throw new InvalidArgumentError("invalid request path");
}
if (typeof method !== "string") {
throw new InvalidArgumentError("method must be a string");
} else if (!isValidHTTPToken(method)) {
} else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) {
throw new InvalidArgumentError("invalid request method");
}
if (upgrade && typeof upgrade !== "string") {
@@ -20773,7 +20797,7 @@ var require_connect2 = __commonJS({
}
};
}
function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero");
}
@@ -20789,7 +20813,7 @@ var require_connect2 = __commonJS({
}
servername = servername || options.servername || util.getServerName(host) || null;
const sessionKey = servername || hostname;
const session = sessionCache.get(sessionKey) || null;
const session = customSession || sessionCache.get(sessionKey) || null;
assert(sessionKey);
socket = tls.connect({
highWaterMark: 16384,
@@ -22307,7 +22331,7 @@ var require_util9 = __commonJS({
var { getGlobalOrigin } = require_global3();
var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url();
var { performance: performance2 } = require("node:perf_hooks");
var { isBlobLike, ReadableStreamFrom, isValidHTTPToken } = require_util8();
var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util8();
var assert = require("node:assert");
var { isUint8Array } = require("node:util/types");
var { webidl } = require_webidl2();
@@ -22414,7 +22438,7 @@ var require_util9 = __commonJS({
}
function appendRequestOriginHeader(request2) {
let serializedOrigin = request2.origin;
if (serializedOrigin === "client") {
if (serializedOrigin === "client" || serializedOrigin === void 0) {
return;
}
if (request2.responseTainting === "cors" || request2.mode === "websocket") {
@@ -22695,29 +22719,8 @@ var require_util9 = __commonJS({
function isCancelled(fetchParams) {
return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated";
}
var normalizeMethodRecordBase = {
delete: "DELETE",
DELETE: "DELETE",
get: "GET",
GET: "GET",
head: "HEAD",
HEAD: "HEAD",
options: "OPTIONS",
OPTIONS: "OPTIONS",
post: "POST",
POST: "POST",
put: "PUT",
PUT: "PUT"
};
var normalizeMethodRecord = {
...normalizeMethodRecordBase,
patch: "patch",
PATCH: "PATCH"
};
Object.setPrototypeOf(normalizeMethodRecordBase, null);
Object.setPrototypeOf(normalizeMethodRecord, null);
function normalizeMethod(method) {
return normalizeMethodRecordBase[method.toLowerCase()] ?? method;
return normalizedMethodRecordsBase[method.toLowerCase()] ?? method;
}
function serializeJavascriptValueToJSONString(value) {
const result = JSON.stringify(value);
@@ -22854,7 +22857,7 @@ var require_util9 = __commonJS({
}
});
}
async function fullyReadBody(body, processBody, processBodyError, shouldClone) {
async function fullyReadBody(body, processBody, processBodyError) {
const successSteps = processBody;
const errorSteps = processBodyError;
let reader;
@@ -22865,7 +22868,7 @@ var require_util9 = __commonJS({
return;
}
try {
successSteps(await readAllBytes(reader, shouldClone));
successSteps(await readAllBytes(reader));
} catch (e) {
errorSteps(e);
}
@@ -22888,19 +22891,12 @@ var require_util9 = __commonJS({
assert(!invalidIsomorphicEncodeValueRegex.test(input));
return input;
}
async function readAllBytes(reader, shouldClone) {
async function readAllBytes(reader) {
const bytes = [];
let byteLength = 0;
while (true) {
const { done, value: chunk } = await reader.read();
if (done) {
if (bytes.length === 1) {
const { buffer, byteOffset, byteLength: byteLength2 } = bytes[0];
if (shouldClone === false) {
return Buffer.from(buffer, byteOffset, byteLength2);
}
return Buffer.from(buffer.slice(byteOffset, byteOffset + byteLength2), 0, byteLength2);
}
return Buffer.concat(bytes, byteLength);
}
if (!isUint8Array(chunk)) {
@@ -23163,7 +23159,6 @@ var require_util9 = __commonJS({
urlHasHttpsScheme,
urlIsHttpHttpsScheme,
readAllBytes,
normalizeMethodRecord,
simpleRangeHeaderValue,
buildContentRange,
parseMetadata,
@@ -23835,18 +23830,18 @@ Content-Type: ${value.type || "application/octet-stream"}\r
mimeType = serializeAMimeType(mimeType);
}
return new Blob2([bytes], { type: mimeType });
}, instance, false);
}, instance);
},
arrayBuffer() {
return consumeBody(this, (bytes) => {
return bytes.buffer;
}, instance, true);
return new Uint8Array(bytes).buffer;
}, instance);
},
text() {
return consumeBody(this, utf8DecodeBytes, instance, false);
return consumeBody(this, utf8DecodeBytes, instance);
},
json() {
return consumeBody(this, parseJSONFromBytes, instance, false);
return consumeBody(this, parseJSONFromBytes, instance);
},
formData() {
return consumeBody(this, (value) => {
@@ -23875,12 +23870,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r
throw new TypeError(
'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
);
}, instance, false);
}, instance);
},
bytes() {
return consumeBody(this, (bytes) => {
return new Uint8Array(bytes.buffer, 0, bytes.byteLength);
}, instance, true);
return new Uint8Array(bytes);
}, instance);
}
};
return methods;
@@ -23888,7 +23883,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
function mixinBody(prototype) {
Object.assign(prototype.prototype, bodyMixinMethods(prototype));
}
async function consumeBody(object, convertBytesToJSValue, instance, shouldClone) {
async function consumeBody(object, convertBytesToJSValue, instance) {
webidl.brandCheck(object, instance);
if (bodyUnusable(object[kState].body)) {
throw new TypeError("Body is unusable: Body has already been read");
@@ -23907,7 +23902,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
successSteps(Buffer.allocUnsafe(0));
return promise.promise;
}
await fullyReadBody(object[kState].body, successSteps, errorSteps, shouldClone);
await fullyReadBody(object[kState].body, successSteps, errorSteps);
return promise.promise;
}
function bodyUnusable(body) {
@@ -24660,25 +24655,25 @@ upgrade: ${upgrade}\r
channels.sendHeaders.publish({ request: request2, headers: header, socket });
}
if (!body || bodyLength === 0) {
writeBuffer({ abort, body: null, client, request: request2, socket, contentLength, header, expectsPayload });
writeBuffer(abort, null, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isBuffer(body)) {
writeBuffer({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload });
writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isBlobLike(body)) {
if (typeof body.stream === "function") {
writeIterable({ abort, body: body.stream(), client, request: request2, socket, contentLength, header, expectsPayload });
writeIterable(abort, body.stream(), client, request2, socket, contentLength, header, expectsPayload);
} else {
writeBlob({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload });
writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload);
}
} else if (util.isStream(body)) {
writeStream({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload });
writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isIterable(body)) {
writeIterable({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload });
writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else {
assert(false);
}
return true;
}
function writeStream({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) {
function writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
let finished = false;
const writer = new AsyncWriter({ abort, socket, request: request2, contentLength, client, expectsPayload, header });
@@ -24747,7 +24742,7 @@ upgrade: ${upgrade}\r
setImmediate(onClose);
}
}
function writeBuffer({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) {
function writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
try {
if (!body) {
if (contentLength === 0) {
@@ -24778,7 +24773,7 @@ upgrade: ${upgrade}\r
abort(err);
}
}
async function writeBlob({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) {
async function writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength === body.size, "blob body must have content length");
try {
if (contentLength != null && contentLength !== body.size) {
@@ -24801,7 +24796,7 @@ upgrade: ${upgrade}\r
abort(err);
}
}
async function writeIterable({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) {
async function writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
let callback = null;
function onDrain() {
@@ -25264,81 +25259,79 @@ var require_client_h2 = __commonJS({
return true;
function writeBodyH2() {
if (!body || contentLength === 0) {
writeBuffer({
writeBuffer(
abort,
stream,
null,
client,
request: request2,
request2,
client[kSocket],
contentLength,
expectsPayload,
h2stream: stream,
body: null,
socket: client[kSocket]
});
expectsPayload
);
} else if (util.isBuffer(body)) {
writeBuffer({
writeBuffer(
abort,
client,
request: request2,
contentLength,
stream,
body,
expectsPayload,
h2stream: stream,
socket: client[kSocket]
});
client,
request2,
client[kSocket],
contentLength,
expectsPayload
);
} else if (util.isBlobLike(body)) {
if (typeof body.stream === "function") {
writeIterable({
writeIterable(
abort,
stream,
body.stream(),
client,
request: request2,
request2,
client[kSocket],
contentLength,
expectsPayload,
h2stream: stream,
body: body.stream(),
socket: client[kSocket]
});
expectsPayload
);
} else {
writeBlob({
writeBlob(
abort,
stream,
body,
client,
request: request2,
request2,
client[kSocket],
contentLength,
expectsPayload,
h2stream: stream,
socket: client[kSocket]
});
expectsPayload
);
}
} else if (util.isStream(body)) {
writeStream({
writeStream(
abort,
client[kSocket],
expectsPayload,
stream,
body,
client,
request: request2,
contentLength,
expectsPayload,
socket: client[kSocket],
h2stream: stream,
header: ""
});
request2,
contentLength
);
} else if (util.isIterable(body)) {
writeIterable({
writeIterable(
abort,
stream,
body,
client,
request: request2,
request2,
client[kSocket],
contentLength,
expectsPayload,
header: "",
h2stream: stream,
socket: client[kSocket]
});
expectsPayload
);
} else {
assert(false);
}
}
}
function writeBuffer({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) {
function writeBuffer(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
try {
if (body != null && util.isBuffer(body)) {
assert(contentLength === body.byteLength, "buffer body must have content length");
@@ -25357,7 +25350,7 @@ var require_client_h2 = __commonJS({
abort(error);
}
}
function writeStream({ abort, socket, expectsPayload, h2stream, body, client, request: request2, contentLength }) {
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) {
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
const pipe = pipeline(
body,
@@ -25381,7 +25374,7 @@ var require_client_h2 = __commonJS({
request2.onBodySent(chunk);
}
}
async function writeBlob({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) {
async function writeBlob(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
assert(contentLength === body.size, "blob body must have content length");
try {
if (contentLength != null && contentLength !== body.size) {
@@ -25402,7 +25395,7 @@ var require_client_h2 = __commonJS({
abort(err);
}
}
async function writeIterable({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) {
async function writeIterable(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
let callback = null;
function onDrain() {
@@ -27147,7 +27140,7 @@ var require_retry_handler = __commonJS({
this.abort(
new RequestRetryError("Content-Range mismatch", statusCode, {
headers,
count: this.retryCount
data: { count: this.retryCount }
})
);
return false;
@@ -27156,7 +27149,7 @@ var require_retry_handler = __commonJS({
this.abort(
new RequestRetryError("ETag mismatch", statusCode, {
headers,
count: this.retryCount
data: { count: this.retryCount }
})
);
return false;
@@ -30380,9 +30373,7 @@ var require_request4 = __commonJS({
var {
isValidHTTPToken,
sameOrigin,
normalizeMethod,
environmentSettingsObject,
normalizeMethodRecord
environmentSettingsObject
} = require_util9();
var {
forbiddenMethodsSet,
@@ -30394,7 +30385,7 @@ var require_request4 = __commonJS({
requestCache,
requestDuplex
} = require_constants8();
var { kEnumerableProperty } = util;
var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util;
var { kHeaders, kSignal, kState, kDispatcher } = require_symbols7();
var { webidl } = require_webidl2();
var { URLSerializer } = require_data_url();
@@ -30591,17 +30582,18 @@ var require_request4 = __commonJS({
}
if (init.method !== void 0) {
let method = init.method;
const mayBeNormalized = normalizeMethodRecord[method];
const mayBeNormalized = normalizedMethodRecords[method];
if (mayBeNormalized !== void 0) {
request2.method = mayBeNormalized;
} else {
if (!isValidHTTPToken(method)) {
throw new TypeError(`'${method}' is not a valid HTTP method.`);
}
if (forbiddenMethodsSet.has(method.toUpperCase())) {
const upperCase = method.toUpperCase();
if (forbiddenMethodsSet.has(upperCase)) {
throw new TypeError(`'${method}' HTTP method is unsupported.`);
}
method = normalizeMethod(method);
method = normalizedMethodRecordsBase[upperCase] ?? method;
request2.method = method;
}
if (!patchMethodWarning && request2.method === "patch") {
@@ -35317,7 +35309,6 @@ var require_websocket2 = __commonJS({
var { types } = require("node:util");
var { ErrorEvent, CloseEvent } = require_events2();
var { SendQueue } = require_sender();
var experimentalWarned = false;
var WebSocket = class _WebSocket extends EventTarget {
#events = {
open: null,
@@ -35338,12 +35329,6 @@ var require_websocket2 = __commonJS({
super();
const prefix = "WebSocket constructor";
webidl.argumentLengthCheck(arguments, 1, prefix);
if (!experimentalWarned) {
experimentalWarned = true;
process.emitWarning("WebSockets are experimental, expect them to change at any time.", {
code: "UNDICI-WS"
});
}
const options = webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"](protocols, prefix, "options");
url = webidl.converters.USVString(url, prefix, "url");
protocols = options.protocols;
+1 -1
View File
@@ -104,7 +104,7 @@ export async function main(
// Make token accessible to post function (so we can invalidate it)
if (!skipTokenRevoke) {
core.saveState("token", authentication.token);
core.setOutput("expiresAt", authentication.expiresAt);
core.saveState("expiresAt", authentication.expiresAt);
}
}
+13 -13
View File
@@ -1,19 +1,19 @@
{
"name": "create-github-app-token",
"version": "1.10.0",
"version": "1.10.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "create-github-app-token",
"version": "1.10.0",
"version": "1.10.2",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.1",
"@octokit/auth-app": "^7.1.0",
"@octokit/request": "^9.0.1",
"p-retry": "^6.2.0",
"undici": "^6.18.2"
"undici": "^6.19.2"
},
"devDependencies": {
"@sinonjs/fake-timers": "^11.2.2",
@@ -994,12 +994,12 @@
}
},
"node_modules/braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true,
"dependencies": {
"fill-range": "^7.0.1"
"fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
@@ -1668,9 +1668,9 @@
"dev": true
},
"node_modules/fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true,
"dependencies": {
"to-regex-range": "^5.0.1"
@@ -3412,9 +3412,9 @@
}
},
"node_modules/undici": {
"version": "6.18.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.18.2.tgz",
"integrity": "sha512-o/MQLTwRm9IVhOqhZ0NQ9oXax1ygPjw6Vs+Vq/4QRjbOAC3B1GCHy7TYxxbExKlb7bzDRzt9vBWU6BDz0RFfYg==",
"version": "6.19.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.19.2.tgz",
"integrity": "sha512-JfjKqIauur3Q6biAtHJ564e3bWa8VvT+7cSiOJHFbX4Erv6CLGDpg8z+Fmg/1OI/47RA+GI2QZaF48SSaLvyBA==",
"engines": {
"node": ">=18.17"
}
+2 -2
View File
@@ -2,7 +2,7 @@
"name": "create-github-app-token",
"private": true,
"type": "module",
"version": "1.10.1",
"version": "1.10.3",
"description": "GitHub Action for creating a GitHub App Installation Access Token",
"scripts": {
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0",
@@ -16,7 +16,7 @@
"@octokit/auth-app": "^7.1.0",
"@octokit/request": "^9.0.1",
"p-retry": "^6.2.0",
"undici": "^6.18.2"
"undici": "^6.19.2"
},
"devDependencies": {
"@sinonjs/fake-timers": "^11.2.2",
+9 -18
View File
@@ -33,8 +33,7 @@ Generated by [AVA](https://avajs.dev).
::set-output name=app-slug::github-actions␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
::save-state name=expiresAt::2016-07-11T22:14:10Z`
## main-missing-app-id.test.js
@@ -94,8 +93,7 @@ Generated by [AVA](https://avajs.dev).
::set-output name=app-slug::github-actions␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
::save-state name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-repo-set-to-many.test.js
@@ -114,8 +112,7 @@ Generated by [AVA](https://avajs.dev).
::set-output name=app-slug::github-actions␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
::save-state name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-repo-set-to-one.test.js
@@ -134,8 +131,7 @@ Generated by [AVA](https://avajs.dev).
::set-output name=app-slug::github-actions␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
::save-state name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-to-org-repo-unset.test.js
@@ -154,8 +150,7 @@ Generated by [AVA](https://avajs.dev).
::set-output name=app-slug::github-actions␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
::save-state name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-to-user-fail-response.test.js
@@ -175,8 +170,7 @@ Generated by [AVA](https://avajs.dev).
::set-output name=app-slug::github-actions␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
::save-state name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-set-to-user-repo-unset.test.js
@@ -195,8 +189,7 @@ Generated by [AVA](https://avajs.dev).
::set-output name=app-slug::github-actions␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
::save-state name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-unset-repo-set.test.js
@@ -215,8 +208,7 @@ Generated by [AVA](https://avajs.dev).
::set-output name=app-slug::github-actions␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
::save-state name=expiresAt::2016-07-11T22:14:10Z`
## main-token-get-owner-unset-repo-unset.test.js
@@ -235,8 +227,7 @@ Generated by [AVA](https://avajs.dev).
::set-output name=app-slug::github-actions␊
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
::set-output name=expiresAt::2016-07-11T22:14:10Z`
::save-state name=expiresAt::2016-07-11T22:14:10Z`
## post-revoke-token-fail-response.test.js
Binary file not shown.