From 733f34c1063143afa9679af725e53cac69c07078 Mon Sep 17 00:00:00 2001 From: Brian Cristante <33549821+brcrista@users.noreply.github.com> Date: Wed, 11 May 2022 17:14:25 -0400 Subject: [PATCH] Update other packages to use http-client v2 (#1082) We moved `@actions/http-client` to be part of the toolkit in https://github.com/actions/toolkit/pull/1062. We also made some breaking changes to exported types and released v2. The biggest change in terms of lines of code affected was to get rid of the `I-` prefix for interfaces since TypeScript doesn't follow this convention. I bumped the patch version of all packages except for `tool-cache`, where I bumped the major version. The rationale is explained in the release notes for that package. --- RELEASES.md | 3 +++ package-lock.json | 37 +++++++++---------------------------- package.json | 4 ++-- src/oidc-utils.ts | 6 +++--- 4 files changed, 17 insertions(+), 33 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index d35801e..2f00f0c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,8 @@ # @actions/core Releases +### 1.8.1 +- Update to v2.0.0 of `@actions/http-client` + ### 1.8.0 - Deprecate `markdownSummary` extension export in favor of `summary` - https://github.com/actions/toolkit/pull/1072 diff --git a/package-lock.json b/package-lock.json index b4392f8..cd2ff3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,62 +1,43 @@ { "name": "@actions/core", - "version": "1.8.0", + "version": "1.8.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/core", - "version": "1.6.0", + "version": "1.8.1", "license": "MIT", "dependencies": { - "@actions/http-client": "^1.0.11" + "@actions/http-client": "^2.0.0" }, "devDependencies": { "@types/node": "^12.0.2" } }, "node_modules/@actions/http-client": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", - "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", - "dependencies": { - "tunnel": "0.0.6" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.0.tgz", + "integrity": "sha512-fm1+OPPey5ypgStT9K8zbBhICj4J4UV/TJIHDhuWlkb8KyJaAtjcZK184dTqul0dV0nPKX97FNtDXX20BTLXSA==" }, "node_modules/@types/node": { "version": "12.0.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==", "dev": true - }, - "node_modules/tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "engines": { - "node": ">=0.6.11 <=0.7.0 || >=0.7.3" - } } }, "dependencies": { "@actions/http-client": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", - "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", - "requires": { - "tunnel": "0.0.6" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.0.tgz", + "integrity": "sha512-fm1+OPPey5ypgStT9K8zbBhICj4J4UV/TJIHDhuWlkb8KyJaAtjcZK184dTqul0dV0nPKX97FNtDXX20BTLXSA==" }, "@types/node": { "version": "12.0.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==", "dev": true - }, - "tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" } } } diff --git a/package.json b/package.json index c63533f..cd91438 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@actions/core", - "version": "1.8.0", + "version": "1.8.1", "description": "Actions core lib", "keywords": [ "github", @@ -36,7 +36,7 @@ "url": "https://github.com/actions/toolkit/issues" }, "dependencies": { - "@actions/http-client": "^1.0.11" + "@actions/http-client": "^2.0.0" }, "devDependencies": { "@types/node": "^12.0.2" diff --git a/src/oidc-utils.ts b/src/oidc-utils.ts index e33da5f..d490a3c 100644 --- a/src/oidc-utils.ts +++ b/src/oidc-utils.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/no-extraneous-class */ import * as actions_http_client from '@actions/http-client' -import {IRequestOptions} from '@actions/http-client/interfaces' +import {RequestOptions} from '@actions/http-client/lib/interfaces' import {HttpClient} from '@actions/http-client' -import {BearerCredentialHandler} from '@actions/http-client/auth' +import {BearerCredentialHandler} from '@actions/http-client/lib/auth' import {debug, setSecret} from './core' interface TokenResponse { value?: string @@ -13,7 +13,7 @@ export class OidcClient { allowRetry = true, maxRetry = 10 ): actions_http_client.HttpClient { - const requestOptions: IRequestOptions = { + const requestOptions: RequestOptions = { allowRetries: allowRetry, maxRetries: maxRetry }