func (g GithubHook) handleRelease(body []byte, repo *git.Repo) error { var release ghRelease err := json.Unmarshal(body, &release) if err != nil { return err } if release.Release.TagName == "" { return errors.New("The release request contained an invalid TagName.") } logger().Printf("Received new release '%s'. -> Updating local repository to this release.", release.Release.Name) // Update the local branch to the release tag name // this will pull the release tag. repo.Branch = release.Release.TagName repo.Pull() return nil }