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
2023-11-02 22:23:07 -07:00
2023-11-02 22:23:07 -07:00
2023-10-06 12:54:48 -07:00
2023-06-08 17:04:10 -07:00
2024-02-08 15:39:04 -08:00
2024-02-08 15:39:04 -08:00

Create GitHub App Token

test

GitHub Action for creating a GitHub App installation access token.

Usage

In order to use this action, you need to:

  1. Register new GitHub App
  2. Store the App's ID in your repository environment variables (example: APP_ID)
  3. Store the App's private key in your repository secrets (example: PRIVATE_KEY)

Important

An installation access token expires after 1 hour. Please see this comment for alternative approaches if you have long-running processes.

Create a token for the current repository

name: Run tests on staging
on:
  push:
    branches:
      - main

jobs:
  hello-world:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ vars.APP_ID }}
          private-key: ${{ secrets.PRIVATE_KEY }}
      - uses: ./actions/staging-tests
        with:
          token: ${{ steps.app-token.outputs.token }}

Use app token with actions/checkout

on: [pull_request]

jobs:
  auto-format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/create-github-app-token@v1
        id: app-token
        with:
          # required
          app-id: ${{ vars.APP_ID }}
          private-key: ${{ secrets.PRIVATE_KEY }}
      - uses: actions/checkout@v4
        with:
          token: ${{ steps.app-token.outputs.token }}
          ref: ${{ github.head_ref }}
          # Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
          persist-credentials: false
      - uses: creyD/prettier_action@v4.3
        with:
          github_token: ${{ steps.app-token.outputs.token }}

Create a git committer string for an app installation

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

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

on: [workflow_dispatch]

jobs:
  hello-world:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ vars.APP_ID }}
          private-key: ${{ secrets.PRIVATE_KEY }}
          owner: ${{ github.repository_owner }}
      - uses: peter-evans/create-or-update-comment@v3
        with:
          token: ${{ steps.app-token.outputs.token }}
          issue-number: ${{ github.event.issue.number }}
          body: "Hello, World!"

Create a token for multiple repositories in the current owner's installation

on: [issues]

jobs:
  hello-world:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ vars.APP_ID }}
          private-key: ${{ secrets.PRIVATE_KEY }}
          owner: ${{ github.repository_owner }}
          repositories: "repo1,repo2"
      - uses: peter-evans/create-or-update-comment@v3
        with:
          token: ${{ steps.app-token.outputs.token }}
          issue-number: ${{ github.event.issue.number }}
          body: "Hello, World!"

Create a token for all repositories in another owner's installation

on: [issues]

jobs:
  hello-world:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ vars.APP_ID }}
          private-key: ${{ secrets.PRIVATE_KEY }}
          owner: another-owner
      - uses: peter-evans/create-or-update-comment@v3
        with:
          token: ${{ steps.app-token.outputs.token }}
          issue-number: ${{ github.event.issue.number }}
          body: "Hello, World!"

Create tokens for multiple user or organization accounts

You can use a matrix strategy to create tokens for multiple user or organization accounts.

Note

See this documentation for information on using multiline strings in workflows.

on: [workflow_dispatch]

jobs:
  set-matrix:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{steps.set.outputs.matrix }}
    steps:
      - id: set
        run: echo 'matrix=[{"owner":"owner1"},{"owner":"owner2","repos":["repo1"]}]' >>"$GITHUB_OUTPUT"

  use-matrix:
    name: "@${{ matrix.owners-and-repos.owner }} installation"
    needs: [set-matrix]
    runs-on: ubuntu-latest
    strategy:
      matrix:
        owners-and-repos: ${{ fromJson(needs.set-matrix.outputs.matrix) }}

    steps:
      - uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ vars.APP_ID }}
          private-key: ${{ secrets.PRIVATE_KEY }}
          owner: ${{ matrix.owners-and-repos.owner }}
          repositories: ${{ join(matrix.owners-and-repos.repos) }}
      - uses: octokit/request-action@v2.x
        id: get-installation-repositories
        with:
          route: GET /installation/repositories
        env:
          GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
      - run: echo "$MULTILINE_JSON_STRING"
        env:
          MULTILINE_JSON_STRING: ${{ steps.get-installation-repositories.outputs.data }}

Run the workflow in a github.com repository against an organization in GitHub Enterprise Server

on: [push]

jobs:
  create_issue:
    runs-on: self-hosted

    steps:
    - name: Create GitHub App token
      id: create_token
      uses: actions/create-github-app-token@v1
      with:
        app-id: ${{ vars.GHES_APP_ID }}
        private-key: ${{ secrets.GHES_APP_PRIVATE_KEY }}
        owner: ${{ vars.GHES_INSTALLATION_ORG }}
        github-api-url: ${{ vars.GITHUB_API_URL }}

    - name: Create issue
      uses: octokit/request-action@v2.x
      with:
        route: POST /repos/${{ github.repository }}/issues
        title: "New issue from workflow"
        body: "This is a new issue created from a GitHub Action workflow."
      env:
        GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}

Inputs

app-id

Required: GitHub App ID.

private-key

Required: GitHub App private key. Escaped newlines (\\n) will be automatically replaced with actual newlines.

owner

Optional: The owner of the GitHub App installation. If empty, defaults to the current repository owner.

repositories

Optional: Comma-separated list of repositories to grant access to.

Note

If owner is set and repositories is empty, access will be scoped to all repositories in the provided repository owner's installation. If owner and repositories are empty, access will be scoped to only the current repository.

skip-token-revoke

Optional: If truthy, the token will not be revoked when the current job is complete.

github-api-url

Optional: The URL of the GitHub REST API. Defaults to the URL of the GitHub Rest API where the workflow is run from.

Outputs

token

GitHub App installation access token.

installation-id

GitHub App installation ID.

app-slug

GitHub App slug.

How it works

The action creates an installation access token using the POST /app/installations/{installation_id}/access_tokens endpoint. By default,

  1. The token is scoped to the current repository or repositories if set.
  2. The token inherits all the installation's permissions.
  3. The token is set as output token which can be used in subsequent steps.
  4. Unless the skip-token-revoke input is set to a truthy value, the token is revoked in the post step of the action, which means it cannot be passed to another job.
  5. The token is masked, it cannot be logged accidentally.

Note

Installation permissions can differ from the app's permissions they belong to. Installation permissions are set when an app is installed on an account. When the app adds more permissions after the installation, an account administrator will have to approve the new permissions before they are set on the installation.

License

MIT

S
Description
Mirror of github.com/actions/create-github-app-token (RFC #229 task #109)
Readme 8.1 MiB
Languages
JavaScript 100%