add logs (#3)

Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
This commit is contained in:
oliverpool 2023-09-20 12:37:11 +00:00 committed by oliverpool
parent 3d5ade3e3b
commit 2ac4f74b36

10
main.go
View file

@ -6,6 +6,7 @@ package main
import (
"errors"
"fmt"
"log"
"strconv"
"github.com/ovh/go-ovh/ovh"
@ -49,11 +50,18 @@ func run(action *githubactions.Action) error {
if err != nil {
return err
}
return client.Put(uri, struct {
log.Println("OVH Client created")
err = client.Put(uri, struct {
SubDomain string `json:"subDomain"`
Target string `json:"target"`
}{
SubDomain: subDomain,
Target: strconv.Quote(value),
}, nil)
if err != nil {
return err
}
log.Println("DNS record updated")
return nil
}