Skip to content

Support semantic version ranges (e.g., ^2.0) for ref input #2290

@jeysaravana

Description

@jeysaravana

Currently, the ref input in actions/checkout only accepts an exact branch, tag, or commit SHA. It would be very helpful if ref could support semantic version ranges, similar to Composer or npm.

For example, suppose a repository has release tags:
1.0.0, 1.0.1, 2.0.0, 2.2.0, 3.0.0

If I pass:

with:
  ref: ^2.0

actions/checkout should automatically pick up the latest compatible tag, in this case 2.2.0.

This feature would simplify workflows that need to checkout the latest minor/patch release in a major version without manually updating the tag every time a new release is published.

Benefits:

  • Avoids hardcoding exact tags in workflows.
  • Makes CI/CD pipelines more robust to minor/patch releases.
  • Brings parity with common package managers that support semver ranges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions