MCPcopy Index your code
hub / github.com/actions/github-script / getUserAgentWithOrchestrationId

Function getUserAgentWithOrchestrationId

src/main.ts:120–130  ·  view source on GitHub ↗

* Gets the user agent string with orchestration ID appended if available * @param userAgent The base user agent string * @returns The user agent string with orchestration ID appended if ACTIONS_ORCHESTRATION_ID is set

(userAgent: string)

Source from the content-addressed store, hash-verified

118 * @returns The user agent string with orchestration ID appended if ACTIONS_ORCHESTRATION_ID is set
119 */
120function getUserAgentWithOrchestrationId(userAgent: string): string {
121 const orchestrationId = process.env['ACTIONS_ORCHESTRATION_ID']
122 if (!orchestrationId) {
123 return userAgent
124 }
125
126 // Sanitize orchestration ID - replace invalid characters with underscore
127 const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '_')
128
129 return `${userAgent} actions_orchestration_id/${sanitized}`
130}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected