Visitar URL original
[Feature]: `make_latest: semver` to mark only the highest version as latest · Issue #867 · softprops/action-gh-release · GitHub
Skip to content

[Feature]: make_latest: semver to mark only the highest version as latest #867

Open

Description

@GabrieleBocchi

Pre-flight checks

  • I searched existing issues and did not find a duplicate request
  • This is not a bug report for existing behavior

Problem to solve

We maintain more than one release line, for example main (v1.1.x) and release/v1.0 (v1.0.x). A patch release on the older line becomes the latest release of the repository.

Example sequence:

  1. Release v1.1.1 from main. It becomes latest.
  2. Release v1.0.1 from release/v1.0. It becomes latest, but v1.1.1 is the highest version.

The GitHub default (make_latest: true) marks the most recent release as latest. make_latest: legacy is not documented clearly ("creation date and higher semantic version"), and its name suggests a deprecated behavior. Thus we cannot rely on it.

Proposed solution

Add a semver value for make_latest:

  • The action reads the existing releases of the repository.
  • It ignores drafts, prereleases, and tags that are not valid semver.
  • It sends make_latest: true if the current tag is the highest version. Otherwise it sends make_latest: false.
  • A leading v is accepted, for example v1.2.3.

Example workflow snippet

- uses: softprops/action-gh-release@v3
  with:
    make_latest: semver

Alternatives considered

  • make_latest: legacy: semantics are not clear and the name suggests it can change or be removed.
  • Compute the value in a workflow step (list the tags, sort by version, compare with github.ref) and pass true or false. This works, but every repository must copy the same glue code.

Why this belongs in action-gh-release

The action already reads and creates releases, and already knows which releases are drafts or prereleases. Maintenance branches are a common setup, and today every project must write the same comparison by hand. One input value removes that glue and gives the correct latest release by default for this setup.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions