diff --git a/.licenses/npm/@actions/core-2.0.1.dep.yml b/.licenses/npm/@actions/core-2.0.2.dep.yml similarity index 98% rename from .licenses/npm/@actions/core-2.0.1.dep.yml rename to .licenses/npm/@actions/core-2.0.2.dep.yml index eb49b54d..5c1ceb1a 100644 --- a/.licenses/npm/@actions/core-2.0.1.dep.yml +++ b/.licenses/npm/@actions/core-2.0.2.dep.yml @@ -1,6 +1,6 @@ --- name: "@actions/core" -version: 2.0.1 +version: 2.0.2 type: npm summary: Actions core lib homepage: https://github.com/actions/toolkit/tree/main/packages/core diff --git a/.licenses/npm/@actions/http-client-3.0.0.dep.yml b/.licenses/npm/@actions/http-client-3.0.1.dep.yml similarity index 98% rename from .licenses/npm/@actions/http-client-3.0.0.dep.yml rename to .licenses/npm/@actions/http-client-3.0.1.dep.yml index f4e639f8..46654f90 100644 --- a/.licenses/npm/@actions/http-client-3.0.0.dep.yml +++ b/.licenses/npm/@actions/http-client-3.0.1.dep.yml @@ -1,6 +1,6 @@ --- name: "@actions/http-client" -version: 3.0.0 +version: 3.0.1 type: npm summary: Actions Http Client homepage: https://github.com/actions/toolkit/tree/main/packages/http-client diff --git a/dist/index.js b/dist/index.js index 50ecb95f..4bb422e3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2531,7 +2531,7 @@ class HttpClient { this._maxRetries = 1; this._keepAlive = false; this._disposed = false; - this.userAgent = userAgent; + this.userAgent = this._getUserAgentWithOrchestrationId(userAgent); this.handlers = handlers || []; this.requestOptions = requestOptions; if (requestOptions) { @@ -3011,6 +3011,17 @@ class HttpClient { } return proxyAgent; } + _getUserAgentWithOrchestrationId(userAgent) { + const baseUserAgent = userAgent || 'actions/http-client'; + const orchId = process.env['ACTIONS_ORCHESTRATION_ID']; + if (orchId) { + // Sanitize the orchestration ID to ensure it contains only valid characters + // Valid characters: 0-9, a-z, _, -, . + const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_'); + return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`; + } + return baseUserAgent; + } _performExponentialBackoff(retryNumber) { return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); diff --git a/package-lock.json b/package-lock.json index 59350947..9bcc70b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "name": "setup-task", "license": "GPL-3.0", "dependencies": { - "@actions/core": "^2.0.1", + "@actions/core": "^2.0.2", "@actions/tool-cache": "^2.0.2", "semver": "^7.7.3", "typed-rest-client": "^2.1.0" @@ -52,12 +52,12 @@ } }, "node_modules/@actions/core": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.1.tgz", - "integrity": "sha512-oBfqT3GwkvLlo1fjvhQLQxuwZCGTarTE5OuZ2Wg10hvhBj7LRIlF611WT4aZS6fDhO5ZKlY7lCAZTlpmyaHaeg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.2.tgz", + "integrity": "sha512-Ast1V7yHbGAhplAsuVlnb/5J8Mtr/Zl6byPPL+Qjq3lmfIgWF1ak1iYfF/079cRERiuTALTXkSuEUdZeDCfGtA==", "dependencies": { "@actions/exec": "^2.0.0", - "@actions/http-client": "^3.0.0" + "@actions/http-client": "^3.0.1" } }, "node_modules/@actions/core/node_modules/@actions/exec": { @@ -69,9 +69,9 @@ } }, "node_modules/@actions/core/node_modules/@actions/http-client": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.0.tgz", - "integrity": "sha512-1s3tXAfVMSz9a4ZEBkXXRQD4QhY3+GAsWSbaYpeknPOKEeyRiU3lH+bHiLMZdo2x/fIeQ/hscL1wCkDLVM2DZQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.1.tgz", + "integrity": "sha512-SbGS8c/vySbNO3kjFgSW77n83C4MQx/Yoe+b1hAdpuvfHxnkHzDq2pWljUpAA56Si1Gae/7zjeZsV0CYjmLo/w==", "dependencies": { "tunnel": "^0.0.6", "undici": "^5.28.5" @@ -11303,12 +11303,12 @@ "dev": true }, "@actions/core": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.1.tgz", - "integrity": "sha512-oBfqT3GwkvLlo1fjvhQLQxuwZCGTarTE5OuZ2Wg10hvhBj7LRIlF611WT4aZS6fDhO5ZKlY7lCAZTlpmyaHaeg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.2.tgz", + "integrity": "sha512-Ast1V7yHbGAhplAsuVlnb/5J8Mtr/Zl6byPPL+Qjq3lmfIgWF1ak1iYfF/079cRERiuTALTXkSuEUdZeDCfGtA==", "requires": { "@actions/exec": "^2.0.0", - "@actions/http-client": "^3.0.0" + "@actions/http-client": "^3.0.1" }, "dependencies": { "@actions/exec": { @@ -11320,9 +11320,9 @@ } }, "@actions/http-client": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.0.tgz", - "integrity": "sha512-1s3tXAfVMSz9a4ZEBkXXRQD4QhY3+GAsWSbaYpeknPOKEeyRiU3lH+bHiLMZdo2x/fIeQ/hscL1wCkDLVM2DZQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.1.tgz", + "integrity": "sha512-SbGS8c/vySbNO3kjFgSW77n83C4MQx/Yoe+b1hAdpuvfHxnkHzDq2pWljUpAA56Si1Gae/7zjeZsV0CYjmLo/w==", "requires": { "tunnel": "^0.0.6", "undici": "^5.28.5" diff --git a/package.json b/package.json index d9ad97b0..ea9f399b 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "author": "Arduino", "license": "GPL-3.0", "dependencies": { - "@actions/core": "^2.0.1", + "@actions/core": "^2.0.2", "@actions/tool-cache": "^2.0.2", "semver": "^7.7.3", "typed-rest-client": "^2.1.0"