Skip to content

Commit a7b65c0

Browse files
chore(release): build dist
1 parent 2c1ba1a commit a7b65c0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

run/dist/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2516,7 +2516,7 @@ class HttpClient {
25162516
this._maxRetries = 1;
25172517
this._keepAlive = false;
25182518
this._disposed = false;
2519-
this.userAgent = userAgent;
2519+
this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);
25202520
this.handlers = handlers || [];
25212521
this.requestOptions = requestOptions;
25222522
if (requestOptions) {
@@ -2996,6 +2996,17 @@ class HttpClient {
29962996
}
29972997
return proxyAgent;
29982998
}
2999+
_getUserAgentWithOrchestrationId(userAgent) {
3000+
const baseUserAgent = userAgent || 'actions/http-client';
3001+
const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
3002+
if (orchId) {
3003+
// Sanitize the orchestration ID to ensure it contains only valid characters
3004+
// Valid characters: 0-9, a-z, _, -, .
3005+
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
3006+
return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;
3007+
}
3008+
return baseUserAgent;
3009+
}
29993010
_performExponentialBackoff(retryNumber) {
30003011
return __awaiter(this, void 0, void 0, function* () {
30013012
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);

0 commit comments

Comments
 (0)