Skip to content

Commit

Permalink
fix: github now requires explicit make_latest=true on update
Browse files Browse the repository at this point in the history
  • Loading branch information
msvticket committed Jun 5, 2024
1 parent b6e67c8 commit 15f18fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scm/driver/github/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type releaseInput struct {
Commitish string `json:"target_commitish,omitempty"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
MakeLatest string `json:"make_latest"`
}

func (s *releaseService) Find(ctx context.Context, repo string, id int) (*scm.Release, *scm.Response, error) {
Expand Down Expand Up @@ -97,6 +98,9 @@ func (s *releaseService) Update(ctx context.Context, repo string, id int, input
}
in.Draft = input.Draft
in.Prerelease = input.Prerelease
if !(in.Prerelease || in.Draft) {
in.MakeLatest = "true"
}
out := new(release)
res, err := s.client.do(ctx, "PATCH", path, in, out)
return convertRelease(out), res, err
Expand Down

0 comments on commit 15f18fe

Please sign in to comment.