mirror of
https://code.forgejo.org/actions/ovh-dns-update.git
synced 2024-11-23 23:21:01 -05:00
add logs (#3)
Co-authored-by: oliverpool <git@olivier.pfad.fr> Co-committed-by: oliverpool <git@olivier.pfad.fr>
This commit is contained in:
parent
3d5ade3e3b
commit
2ac4f74b36
1 changed files with 9 additions and 1 deletions
10
main.go
10
main.go
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue