Skip to content

Commit c405b1f

Browse files
authored
[WIP] Fix failing GitHub Actions job Integration: Workflow Features (#38261)
1 parent 1d44e39 commit c405b1f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

pkg/workflow/allowed_domains_sanitization_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,9 @@ Test workflow with GITHUB_COPILOT_BASE_URL in engine.env.
707707
// The copilot API target should be derived from the env var and present in the
708708
// AWF JSON config (apiProxy.targets.copilot.host) rather than as a --copilot-api-target
709709
// CLI flag, since network/proxy settings are now expressed via --config JSON file.
710-
if !strings.Contains(lockStr, `"copilot":{"host":"copilot-proxy.corp.example.com"}`) {
710+
copilotHostUnescaped := `"copilot":{"host":"copilot-proxy.corp.example.com"}`
711+
copilotHostEscaped := `\"copilot\":{\"host\":\"copilot-proxy.corp.example.com\"}`
712+
if !strings.Contains(lockStr, copilotHostUnescaped) && !strings.Contains(lockStr, copilotHostEscaped) {
711713
t.Error("Expected copilot API target to be derived from GITHUB_COPILOT_BASE_URL in AWF config JSON")
712714
}
713715

@@ -716,7 +718,12 @@ Test workflow with GITHUB_COPILOT_BASE_URL in engine.env.
716718
// We search for the allowDomains key followed by its opening "[" and verify the hostname
717719
// appears before the closing "]" of that specific array.
718720
allowDomainsPrefix := `"allowDomains":[`
721+
allowDomainsPrefixEscaped := `\"allowDomains\":[`
719722
allowDomainsIdx := strings.Index(lockStr, allowDomainsPrefix)
723+
if allowDomainsIdx < 0 {
724+
allowDomainsPrefix = allowDomainsPrefixEscaped
725+
allowDomainsIdx = strings.Index(lockStr, allowDomainsPrefixEscaped)
726+
}
720727
if allowDomainsIdx < 0 {
721728
t.Fatal("allowDomains key not found in compiled lock file")
722729
}

0 commit comments

Comments
 (0)