@@ -21,7 +21,7 @@ describe('getUserAgentWithOrchestrationId', () => {
2121 process . env [ 'ACTIONS_ORCHESTRATION_ID' ] = orchestrationId
2222
2323 // Simulate the logic from getUserAgentWithOrchestrationId
24- const sanitized = orchestrationId . replace ( / [ ^ a - z A - Z 0 - 9 . - ] / g, '' )
24+ const sanitized = orchestrationId . replace ( / [ ^ a - z A - Z 0 - 9 . _ - ] / g, '' )
2525 const result = `${ baseUserAgent } orchestration-id/${ sanitized } `
2626
2727 expect ( result ) . toBe (
@@ -34,24 +34,24 @@ describe('getUserAgentWithOrchestrationId', () => {
3434 const orchestrationId = 'test@orchestration#123!abc$xyz'
3535
3636 // Simulate the logic from getUserAgentWithOrchestrationId
37- const sanitized = orchestrationId . replace ( / [ ^ a - z A - Z 0 - 9 . - ] / g, '' )
37+ const sanitized = orchestrationId . replace ( / [ ^ a - z A - Z 0 - 9 . _ - ] / g, '' )
3838 const result = `${ baseUserAgent } orchestration-id/${ sanitized } `
3939
4040 expect ( result ) . toBe (
4141 'actions/github-script orchestration-id/testorchestration123abcxyz'
4242 )
4343 } )
4444
45- test ( 'preserves dots and hyphens in orchestration ID' , ( ) => {
45+ test ( 'preserves dots, hyphens, and underscores in orchestration ID' , ( ) => {
4646 const baseUserAgent = 'actions/github-script'
47- const orchestrationId = 'test.orchestration-123 '
47+ const orchestrationId = 'test.orchestration-123_abc '
4848
4949 // Simulate the logic from getUserAgentWithOrchestrationId
50- const sanitized = orchestrationId . replace ( / [ ^ a - z A - Z 0 - 9 . - ] / g, '' )
50+ const sanitized = orchestrationId . replace ( / [ ^ a - z A - Z 0 - 9 . _ - ] / g, '' )
5151 const result = `${ baseUserAgent } orchestration-id/${ sanitized } `
5252
5353 expect ( result ) . toBe (
54- 'actions/github-script orchestration-id/test.orchestration-123 '
54+ 'actions/github-script orchestration-id/test.orchestration-123_abc '
5555 )
5656 } )
5757
@@ -73,7 +73,7 @@ describe('getUserAgentWithOrchestrationId', () => {
7373 const orchestrationId = '@#$%^&*()'
7474
7575 // Simulate the logic from getUserAgentWithOrchestrationId
76- const sanitized = orchestrationId . replace ( / [ ^ a - z A - Z 0 - 9 . - ] / g, '' )
76+ const sanitized = orchestrationId . replace ( / [ ^ a - z A - Z 0 - 9 . _ - ] / g, '' )
7777 const result = sanitized
7878 ? `${ baseUserAgent } orchestration-id/${ sanitized } `
7979 : baseUserAgent
0 commit comments