Skip to content

Commit 781a9f0

Browse files
committed
chore: committing generated dist
1 parent 0fbbbfc commit 781a9f0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

dist/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2214,7 +2214,7 @@ class HttpClient {
22142214
this._maxRetries = 1;
22152215
this._keepAlive = false;
22162216
this._disposed = false;
2217-
this.userAgent = userAgent;
2217+
this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);
22182218
this.handlers = handlers || [];
22192219
this.requestOptions = requestOptions;
22202220
if (requestOptions) {
@@ -2694,6 +2694,17 @@ class HttpClient {
26942694
}
26952695
return proxyAgent;
26962696
}
2697+
_getUserAgentWithOrchestrationId(userAgent) {
2698+
const baseUserAgent = userAgent || 'actions/http-client';
2699+
const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
2700+
if (orchId) {
2701+
// Sanitize the orchestration ID to ensure it contains only valid characters
2702+
// Valid characters: 0-9, a-z, _, -, .
2703+
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
2704+
return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;
2705+
}
2706+
return baseUserAgent;
2707+
}
26972708
_performExponentialBackoff(retryNumber) {
26982709
return __awaiter(this, void 0, void 0, function* () {
26992710
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)