diff options
Diffstat (limited to 'ops')
-rw-r--r-- | ops/besadii/main.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ops/besadii/main.go b/ops/besadii/main.go index e9feadd9538e..c417cb0a1279 100644 --- a/ops/besadii/main.go +++ b/ops/besadii/main.go @@ -94,12 +94,17 @@ func triggerBuild(branch, commit string) { log.Fatalln("[ERROR] failed to create an HTTP request:", err) } - req.Header.Add("Authorization", fmt.Sprintf("token %s", os.Getenv("SRHT_TOKEN"))) + token := fmt.Sprintf("token %s", os.Getenv("SRHT_TOKEN")) + if token == "" { + log.Fatalln("[ERROR] sourcehut token is not set") + } + + req.Header.Add("Authorization", ) req.Header.Add("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { - // This might indicate a temporary error on the SourceHut side, do + // This might indicate a temporary error on the sourcehut side, do // not fail the whole program. log.Println("failed to send builds.sr.ht request:", err) return |