Skip to content

fix: release marked as 'latest' despite make_latest: false#715

Merged
chenrui333 merged 2 commits intosoftprops:masterfrom
Boshen:fix-latest
Mar 14, 2026
Merged

fix: release marked as 'latest' despite make_latest: false#715
chenrui333 merged 2 commits intosoftprops:masterfrom
Boshen:fix-latest

Conversation

@Boshen
Copy link
Copy Markdown
Contributor

@Boshen Boshen commented Dec 24, 2025

fixes https://github.com/Boshen/action-gh-release/releases/tag/test-20490403435

To test, I enabled immutable releases, pushed a make_latest: false in https://github.com/Boshen/action-gh-release/actions/runs/20490520097/job/58881730816, the release https://github.com/Boshen/action-gh-release/releases/tag/test-20490520097 does not show the latest tag.


Ref: https://github.com/octokit/openapi-types.ts/blob/main/packages/openapi-types/types.d.ts

See make_latest for "repos/update-release":

  /**
   * Update a release
   * @description Users with push access to the repository can edit a release.
   */
  "repos/update-release": {
    parameters: {
      path: {
        owner: components["parameters"]["owner"];
        repo: components["parameters"]["repo"];
        release_id: components["parameters"]["release-id"];
      };
    };
    requestBody?: {
      content: {
        "application/json": {
          /** @description The name of the tag. */
          tag_name?: string;
          /** @description Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. */
          target_commitish?: string;
          /** @description The name of the release. */
          name?: string;
          /** @description Text describing the contents of the tag. */
          body?: string;
          /** @description `true` makes the release a draft, and `false` publishes the release. */
          draft?: boolean;
          /** @description `true` to identify the release as a prerelease, `false` to identify the release as a full release. */
          prerelease?: boolean;
          /**
           * @description Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Defaults to `true` for newly published releases. `legacy` specifies that the latest release should be determined based on the release creation date and higher semantic version.
           * @default true
           * @enum {string}
           */
          make_latest?: "true" | "false" | "legacy";
          /** @description If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. If there is already a discussion linked to the release, this parameter is ignored. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)." */
          discussion_category_name?: string;
        };
      };
    };
    responses: {
      /** @description Response */
      200: {
        content: {
          "application/json": components["schemas"]["release"];
        };
      };
      /** @description Not Found if the discussion category name is invalid */
      404: {
        content: {
          "application/json": components["schemas"]["basic-error"];
        };
      };
    };
  };

AI disclaimer: I used Claude to find and fix the bug, which produced the same result as #706

@chenrui333
Copy link
Copy Markdown
Collaborator

@Boshen how did you test it? do you have any test repo to verify the fix?

@Boshen
Copy link
Copy Markdown
Contributor Author

Boshen commented Dec 31, 2025

@Boshen how did you test it? do you have any test repo to verify the fix?

Did I miss any info from the PR description?

@cerisier
Copy link
Copy Markdown

cerisier commented Mar 7, 2026

Can we merge this and make a release ?

@chenrui333 chenrui333 added the bug Something isn't working label Mar 14, 2026
@chenrui333
Copy link
Copy Markdown
Collaborator

gonna get this pr merged today

Boshen and others added 2 commits March 14, 2026 19:50
The finalizeRelease function was not passing the make_latest parameter
when publishing a release (setting draft: false). According to the
GitHub API, make_latest defaults to `true` for newly published releases,
so `make_latest: false` was being ignored.

Ref: https://github.com/octokit/openapi-types.ts/blob/main/packages/openapi-types/types.d.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Rui Chen <rui@chenrui.dev>
@chenrui333 chenrui333 merged commit b3b644b into softprops:master Mar 14, 2026
1 check passed
@chenrui333
Copy link
Copy Markdown
Collaborator

Thanks @Boshen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants