-
-
Notifications
You must be signed in to change notification settings - Fork 562
Description
Description
In v2.5.0, make_latest: false is not honored. The release is still marked as "latest" despite explicitly setting make_latest: false.
Root Cause
PR #692 introduced a new flow where releases are created as drafts first, then published after artifacts are uploaded. However, the finalizeRelease function in src/github.ts does not pass make_latest when updating the release:
async finalizeRelease(params: { owner: string; repo: string; release_id: number }) {
return await this.github.rest.repos.updateRelease({
owner: params.owner,
repo: params.repo,
release_id: params.release_id,
draft: false, // make_latest is not passed here
});
}When make_latest is omitted from the updateRelease call, GitHub's API defaults to determining "latest" based on semver comparison, ignoring the original make_latest: false setting from when the draft was created.
Steps to Reproduce
- Use
softprops/action-gh-release@v2(resolves to v2.5.0) - Set
make_latest: falsein the workflow - Create a release for a version that would be considered "latest" by semver
- Observe that the release is marked as "latest" despite the setting
Expected Behavior
The release should NOT be marked as "latest" when make_latest: false is specified.
Actual Behavior
The release IS marked as "latest" because make_latest is not passed during the finalizeRelease call.
Suggested Fix
Pass make_latest to the updateRelease call in finalizeRelease:
async finalizeRelease(params: { owner: string; repo: string; release_id: number; make_latest?: string }) {
return await this.github.rest.repos.updateRelease({
owner: params.owner,
repo: params.repo,
release_id: params.release_id,
draft: false,
make_latest: params.make_latest,
});
}Workaround
Pin to v2.4.2: uses: softprops/[email protected]