Skip to content

fix(release): attach release assets while the release is still a draft - #53

Merged
kieronlanning merged 1 commit into
mainfrom
fix/release-assets-draft
Nov 16, 2026
Merged

kieronlanning merged 1 commit into
mainfrom
fix/release-assets-draft

Conversation

@kieronlanning

Copy link
Copy Markdown
Contributor

fix(release): attach release assets while the release is still a draft

GitHub accepts release assets only on a release that has not been published yet. In a
repository with release immutability enabled the asset endpoint rejects the upload
outright:

Octokit.ApiValidationException: Cannot upload assets to an immutable release.
  at Purview.Build.Modules.UploadArtifactsAsync

The release was created published and the artifacts were uploaded afterwards, so a
repository with immutable releases could not publish an artifact-bearing release: the
tag and release appeared, the asset upload failed, and the run failed in
CreateGitHubReleaseModule.

A release that carries artifacts is now created as a draft, the artifacts are attached,
and the release is published once they are there. A release with nothing to attach is
still created and published in a single call, as before. Publishing is what creates the
tag, so nothing observable appears before the artifacts exist.

Version 0.9.2.

GitHub accepts release assets only on a release that has not been published yet. In a
repository with release immutability enabled the asset endpoint rejects the upload
outright:

    Octokit.ApiValidationException: Cannot upload assets to an immutable release.
      at Purview.Build.Modules.UploadArtifactsAsync

The release was created published and the artifacts were uploaded afterwards, so a
repository with immutable releases could not publish an artifact-bearing release: the
tag and release appeared, the asset upload failed, and the run failed in
CreateGitHubReleaseModule.

A release that carries artifacts is now created as a draft, the artifacts are attached,
and the release is published once they are there. A release with nothing to attach is
still created and published in a single call, as before. Publishing is what creates the
tag, so nothing observable appears before the artifacts exist.

Version 0.9.2.
@kieronlanning
kieronlanning merged commit fbb3071 into main Nov 16, 2026
4 checks passed
@kieronlanning
kieronlanning deleted the fix/release-assets-draft branch November 16, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant