mirror of
https://github.com/actions/checkout.git
synced 2026-01-20 23:58:56 +08:00
Simplify orchestration ID validation to accept any non-empty sanitized value
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
This commit is contained in:
parent
4b8779770e
commit
818b5b3072
3 changed files with 5 additions and 7 deletions
3
dist/index.js
vendored
3
dist/index.js
vendored
|
|
@ -1213,8 +1213,7 @@ 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, '_');
|
||||
// Only append if sanitized ID contains at least one alphanumeric character
|
||||
if (sanitizedId && /[a-z0-9]/i.test(sanitizedId)) {
|
||||
if (sanitizedId) {
|
||||
gitHttpUserAgent = `${gitHttpUserAgent} actions_orchestration_id/${sanitizedId}`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue