Skip to content

Conversation

@Boshen
Copy link

@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

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>
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