Skip to content

Commit a9f93d3

Browse files
committed
[AUTO] Update generated code
1 parent 4048a6d commit a9f93d3

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

dist/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2587,7 +2587,7 @@ class HttpClient {
25872587
this._maxRetries = 1;
25882588
this._keepAlive = false;
25892589
this._disposed = false;
2590-
this.userAgent = userAgent;
2590+
this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);
25912591
this.handlers = handlers || [];
25922592
this.requestOptions = requestOptions;
25932593
if (requestOptions) {
@@ -3067,6 +3067,17 @@ class HttpClient {
30673067
}
30683068
return proxyAgent;
30693069
}
3070+
_getUserAgentWithOrchestrationId(userAgent) {
3071+
const baseUserAgent = userAgent || 'actions/http-client';
3072+
const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
3073+
if (orchId) {
3074+
// Sanitize the orchestration ID to ensure it contains only valid characters
3075+
// Valid characters: 0-9, a-z, _, -, .
3076+
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
3077+
return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;
3078+
}
3079+
return baseUserAgent;
3080+
}
30703081
_performExponentialBackoff(retryNumber) {
30713082
return __awaiter(this, void 0, void 0, function* () {
30723083
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);

0 commit comments

Comments
 (0)