Don't prepend server URL if its an empty string

Instead of getting the URL "https://" which causes some actions to fail, they will now get the empty string if no instance is set (such as when running `exec`). Some github.com/actions actions such as cache fail with cryptic errors with an invalid URL
This commit is contained in:
Andrew Cassidy 2025-10-10 23:39:04 -07:00
parent 02247b852a
commit 5163d401dc
No known key found for this signature in database

View file

@ -1355,7 +1355,7 @@ func (rc *RunContext) withGithubEnv(ctx context.Context, github *model.GithubCon
{ // Adapt to Forgejo
instance := rc.Config.GitHubInstance
if !strings.HasPrefix(instance, "http://") &&
if instance != "" && !strings.HasPrefix(instance, "http://") &&
!strings.HasPrefix(instance, "https://") {
instance = "https://" + instance
}