Skip to content

Commit 52e5326

Browse files
committed
chore: update package-lock and bundle
1 parent 47477f2 commit 52e5326

File tree

3 files changed

+24
-29
lines changed

3 files changed

+24
-29
lines changed

dist/post/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2226,7 +2226,7 @@ class HttpClient {
22262226
this._maxRetries = 1;
22272227
this._keepAlive = false;
22282228
this._disposed = false;
2229-
this.userAgent = userAgent;
2229+
this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);
22302230
this.handlers = handlers || [];
22312231
this.requestOptions = requestOptions;
22322232
if (requestOptions) {
@@ -2706,6 +2706,17 @@ class HttpClient {
27062706
}
27072707
return proxyAgent;
27082708
}
2709+
_getUserAgentWithOrchestrationId(userAgent) {
2710+
const baseUserAgent = userAgent || 'actions/http-client';
2711+
const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
2712+
if (orchId) {
2713+
// Sanitize the orchestration ID to ensure it contains only valid characters
2714+
// Valid characters: 0-9, a-z, _, -, .
2715+
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
2716+
return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;
2717+
}
2718+
return baseUserAgent;
2719+
}
27092720
_performExponentialBackoff(retryNumber) {
27102721
return __awaiter(this, void 0, void 0, function* () {
27112722
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);

dist/pre/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2226,7 +2226,7 @@ class HttpClient {
22262226
this._maxRetries = 1;
22272227
this._keepAlive = false;
22282228
this._disposed = false;
2229-
this.userAgent = userAgent;
2229+
this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);
22302230
this.handlers = handlers || [];
22312231
this.requestOptions = requestOptions;
22322232
if (requestOptions) {
@@ -2706,6 +2706,17 @@ class HttpClient {
27062706
}
27072707
return proxyAgent;
27082708
}
2709+
_getUserAgentWithOrchestrationId(userAgent) {
2710+
const baseUserAgent = userAgent || 'actions/http-client';
2711+
const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
2712+
if (orchId) {
2713+
// Sanitize the orchestration ID to ensure it contains only valid characters
2714+
// Valid characters: 0-9, a-z, _, -, .
2715+
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
2716+
return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;
2717+
}
2718+
return baseUserAgent;
2719+
}
27092720
_performExponentialBackoff(retryNumber) {
27102721
return __awaiter(this, void 0, void 0, function* () {
27112722
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);

package-lock.json

Lines changed: 0 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)