mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-03-10 06:23:25 +08:00
does release asset ids change when you change one?
This commit is contained in:
parent
7d8ba06740
commit
5bb6f82146
1 changed files with 10 additions and 4 deletions
|
@ -37,13 +37,13 @@ func main() {
|
||||||
}
|
}
|
||||||
c := github.NewClient(oauth2.NewClient(bg(), oauth2.StaticTokenSource(&oauth2.Token{AccessToken: tok})))
|
c := github.NewClient(oauth2.NewClient(bg(), oauth2.StaticTokenSource(&oauth2.Token{AccessToken: tok})))
|
||||||
|
|
||||||
|
for _, f := range files {
|
||||||
|
log.Printf("--- %s", f)
|
||||||
|
|
||||||
log.Println("Getting release info")
|
log.Println("Getting release info")
|
||||||
rel, _, err := c.Repositories.GetReleaseByTag(bg(), owner, repo, tag)
|
rel, _, err := c.Repositories.GetReleaseByTag(bg(), owner, repo, tag)
|
||||||
check(err)
|
check(err)
|
||||||
|
|
||||||
for _, f := range files {
|
|
||||||
log.Printf("--- %s", f)
|
|
||||||
|
|
||||||
var found *github.ReleaseAsset
|
var found *github.ReleaseAsset
|
||||||
var foundOld *github.ReleaseAsset
|
var foundOld *github.ReleaseAsset
|
||||||
for _, ass := range rel.Assets {
|
for _, ass := range rel.Assets {
|
||||||
|
@ -61,6 +61,7 @@ func main() {
|
||||||
n := found.GetName() + ".old"
|
n := found.GetName() + ".old"
|
||||||
found.Name = &n
|
found.Name = &n
|
||||||
log.Println("Renaming old asset")
|
log.Println("Renaming old asset")
|
||||||
|
log.Println(found.GetName(), found.GetID())
|
||||||
_, _, err = c.Repositories.EditReleaseAsset(bg(), owner, repo, found.GetID(), found)
|
_, _, err = c.Repositories.EditReleaseAsset(bg(), owner, repo, found.GetID(), found)
|
||||||
check(err)
|
check(err)
|
||||||
}
|
}
|
||||||
|
@ -81,6 +82,11 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("Editing release body")
|
log.Println("Editing release body")
|
||||||
|
|
||||||
|
log.Println("Getting release info")
|
||||||
|
rel, _, err := c.Repositories.GetReleaseByTag(bg(), owner, repo, tag)
|
||||||
|
check(err)
|
||||||
|
|
||||||
body := strings.TrimSpace(rel.GetBody())
|
body := strings.TrimSpace(rel.GetBody())
|
||||||
lines := strings.Split(body, "\n")
|
lines := strings.Split(body, "\n")
|
||||||
last := lines[len(lines)-1]
|
last := lines[len(lines)-1]
|
||||||
|
|
Loading…
Reference in a new issue