ci(tests): improve test for resources.GetRemote

This commit is contained in:
razonyang 2025-01-17 13:50:16 +08:00
parent 8c08180e0b
commit 455fa0767e

View file

@ -1,5 +1,10 @@
{{ $api := "https://api.github.com" }}
{{ $resp := resources.GetRemote $api }}
{{ if not $resp }}
{{ errorf "failed to get remote: %s" $api }}
{{ with try (resources.GetRemote $api) }}
{{ with .Err }}
{{ errorf "failed to get remote %s: %s." $api . }}
{{ else }}
{{ if not .Value }}
{{ errorf "failed to get remote: %s" $api }}
{{ end }}
{{ end }}
{{ end }}