Skip to content

Commit

Permalink
update downloadURL
Browse files Browse the repository at this point in the history
  • Loading branch information
obgnail committed Jan 4, 2024
1 parent 5641865 commit fd986b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ func uploadImages(ctx context.Context, client *github.Client, images []string) [
_path := fmt.Sprintf("image/%d_%d%s", timestamp, idx, suffix)
message := strconv.FormatInt(timestamp, 10)
options := &github.RepositoryContentFileOptions{Message: &message, Content: data}
_, _, err = client.Repositories.CreateFile(ctx, owner, repo, _path, options)
commit, _, err := client.Repositories.CreateFile(ctx, owner, repo, _path, options)
if err != nil {
fmt.Printf("Error committing file %s: %v", image, err)
continue
}
urls[idx] = fmt.Sprintf("https://raw.githubusercontent.com/%s/%s/master/%s", owner, repo, _path)
urls[idx] = *commit.Content.DownloadURL
}
return urls
}
Expand Down

0 comments on commit fd986b1

Please sign in to comment.