Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Tingluo Huang 2026-01-08 10:13:04 -05:00 committed by GitHub
parent d4d52a9288
commit dbf1fa69f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -738,8 +738,10 @@ class GitCommandManager {
// Sanitize the orchestration ID to ensure it contains only valid characters // Sanitize the orchestration ID to ensure it contains only valid characters
// Valid characters: 0-9, a-z, _, -, . // Valid characters: 0-9, a-z, _, -, .
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_') const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_')
if (sanitizedId.trim().length > 0) {
gitHttpUserAgent = `${gitHttpUserAgent} actions_orchestration_id/${sanitizedId}` gitHttpUserAgent = `${gitHttpUserAgent} actions_orchestration_id/${sanitizedId}`
} }
}
core.debug(`Set git useragent to: ${gitHttpUserAgent}`) core.debug(`Set git useragent to: ${gitHttpUserAgent}`)
this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent