From de894ed8f6e7c0678eb71445d48b215ea167823b Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Mon, 19 Jan 2026 15:07:00 +0100 Subject: [PATCH 1/2] fix: support repositories with immutable releases enabled GitHub's immutable releases feature (GA since Oct 2025) prevents modifying release artifacts after the release is created. This broke chart-releaser because it creates the release first, then uploads assets in a separate API call. This fix creates releases as drafts first, uploads assets, then publishes the release. Draft releases can be modified until they are published, which allows the asset upload to succeed. Fixes helm/chart-releaser-action#228 See: https://github.blog/changelog/2025-10-28-immutable-releases-are-now-generally-available/ Signed-off-by: Chris Burr --- pkg/github/github.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pkg/github/github.go b/pkg/github/github.go index 4143c50d..c30539e1 100644 --- a/pkg/github/github.go +++ b/pkg/github/github.go @@ -102,8 +102,14 @@ func (c *Client) GetRelease(_ context.Context, tag string) (*Release, error) { return result, nil } -// CreateRelease creates a new release object in the GitHub API +// CreateRelease creates a new release object in the GitHub API. +// To support repositories with immutable releases enabled (see +// https://github.blog/changelog/2025-10-28-immutable-releases-are-now-generally-available/), +// the release is first created as a draft, assets are uploaded, and then +// the release is published. This ensures that assets can be uploaded before +// the release becomes immutable. func (c *Client) CreateRelease(_ context.Context, input *Release) error { + draft := true req := &github.RepositoryRelease{ Name: &input.Name, Body: &input.Description, @@ -111,6 +117,7 @@ func (c *Client) CreateRelease(_ context.Context, input *Release) error { TargetCommitish: &input.Commit, GenerateReleaseNotes: &input.GenerateReleaseNotes, MakeLatest: &input.MakeLatest, + Draft: &draft, } release, _, err := c.Repositories.CreateRelease(context.TODO(), c.owner, c.repo, req) @@ -123,6 +130,17 @@ func (c *Client) CreateRelease(_ context.Context, input *Release) error { return err } } + + // Publish the release by setting draft to false + draft = false + req = &github.RepositoryRelease{ + Draft: &draft, + } + _, _, err = c.Repositories.EditRelease(context.TODO(), c.owner, c.repo, *release.ID, req) + if err != nil { + return errors.Wrap(err, "failed to publish release") + } + return nil } From 7a93a55f636493c7a39d7b57fbd650ee95bfa233 Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Tue, 17 Feb 2026 20:02:40 +0100 Subject: [PATCH 2/2] fix: ensure MakeLatest doesn't reset to true Co-authored-by: Hsn723 Signed-off-by: Chris Burr --- pkg/github/github.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/github/github.go b/pkg/github/github.go index c30539e1..078db689 100644 --- a/pkg/github/github.go +++ b/pkg/github/github.go @@ -134,7 +134,8 @@ func (c *Client) CreateRelease(_ context.Context, input *Release) error { // Publish the release by setting draft to false draft = false req = &github.RepositoryRelease{ - Draft: &draft, + MakeLatest: &input.MakeLatest, + Draft: &draft, } _, _, err = c.Repositories.EditRelease(context.TODO(), c.owner, c.repo, *release.ID, req) if err != nil {