diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index e3f81b5..56d4f32 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,16 +1,27 @@ +--- name: Backport on: - pull_request: + pull_request_target: types: - closed - labeled jobs: backport: - runs-on: ubuntu-latest name: Backport + runs-on: ubuntu-latest + # Only react to merged PRs for security reasons. + # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. + if: > + github.event.pull_request.merged + && ( + github.event.action == 'closed' + || ( + github.event.action == 'labeled' + && contains(github.event.label.name, 'backport') + ) + ) steps: - - name: Backport - uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2 + - uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/backport.yml b/backport.yml deleted file mode 100644 index 56d4f32..0000000 --- a/backport.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Backport -on: - pull_request_target: - types: - - closed - - labeled - -jobs: - backport: - name: Backport - runs-on: ubuntu-latest - # Only react to merged PRs for security reasons. - # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. - if: > - github.event.pull_request.merged - && ( - github.event.action == 'closed' - || ( - github.event.action == 'labeled' - && contains(github.event.label.name, 'backport') - ) - ) - steps: - - uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 01c3dcc..5cf7dd8 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "ms": "^2.1.3", "secure-json-parse": "^3.0.1", "tslib": "^2.8.1", - "undici": "^6.21.0" + "undici": "^7.2.3" }, "tap": { "files": [ diff --git a/src/connection/UndiciConnection.ts b/src/connection/UndiciConnection.ts index f044d2a..dcd072c 100644 --- a/src/connection/UndiciConnection.ts +++ b/src/connection/UndiciConnection.ts @@ -34,7 +34,7 @@ import BaseConnection, { isCaFingerprintMatch, isBinary } from './BaseConnection' -import { Pool, buildConnector, Dispatcher } from 'undici' +import { Pool, buildConnector } from 'undici' import { ConfigurationError, RequestAbortedError, @@ -165,8 +165,7 @@ export default class Connection extends BaseConnection { debug('Starting a new request', params) let response try { - // @ts-expect-error method it's fine as string - response = (await this.pool.request(requestParams)) as Dispatcher.ResponseData + response = await this.pool.request(requestParams) if (timeoutId != null) clearTimeout(timeoutId) } catch (err: any) { if (timeoutId != null) clearTimeout(timeoutId)