3
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2026-01-13 23:26:16 +00:00

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