Force build to fail when resources.GetRemote returns nil

Is there a way to force a build to fail if resources.GetRemote returns nil? I have a use case where if it returns nil, I can’t let it proceed until I address the issue with the remote resource.

Yes.

{{ $url := “https://example.org” }}
{{ $foo := resources.GetRemote $url }}
{ if not $foo }}
{{ errorf “failed to find %q” $url }}
{{ end }}

1 Like

Thank you!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.