mirror of
https://code.forgejo.org/actions/ovh-dns-update.git
synced 2024-11-24 01:40:59 -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 (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/ovh/go-ovh/ovh"
|
"github.com/ovh/go-ovh/ovh"
|
||||||
|
@ -49,11 +50,18 @@ func run(action *githubactions.Action) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return client.Put(uri, struct {
|
log.Println("OVH Client created")
|
||||||
|
|
||||||
|
err = client.Put(uri, struct {
|
||||||
SubDomain string `json:"subDomain"`
|
SubDomain string `json:"subDomain"`
|
||||||
Target string `json:"target"`
|
Target string `json:"target"`
|
||||||
}{
|
}{
|
||||||
SubDomain: subDomain,
|
SubDomain: subDomain,
|
||||||
Target: strconv.Quote(value),
|
Target: strconv.Quote(value),
|
||||||
}, nil)
|
}, nil)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
log.Println("DNS record updated")
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue