Open Gezi-lzq opened 4 months ago
Compares the tagged version against all existing versions in the repository to determine if it is the highest.
I wonder why you would need this at all? I guess you maintain n and n-1 versions of your project or more right? Such as v1.9.0
patch releases and v1.10.0
. In such case you could just have an env in your workflow that would be the latest version digits like:
env:
LATEST_VERSION: v1.10
And then you could just compare any tag to it by using semver comparison with https://github.com/npm/node-semver and https://github.com/actions/github-script in a dedicated step to set latest as new env for the metadata-action.
Or I guess this would be fine to create a new global expression to handle this and remove extra overhead in your workflow.
Compares the tagged version against all existing versions in the repository to determine if it is the highest.
I wonder why you would need this at all? I guess you maintain n and n-1 versions of your project or more right? Such as
v1.9.0
patch releases andv1.10.0
. In such case you could just have an env in your workflow that would be the latest version digits like:env: LATEST_VERSION: v1.10
And then you could just compare any tag to it by using semver comparison with https://github.com/npm/node-semver and https://github.com/actions/github-script in a dedicated step to set latest as new env for the metadata-action.
Or I guess this would be fine to create a new global expression to handle this and remove extra overhead in your workflow.
Thank you for your suggestion on setting an environment variable for the latest version and using semver comparison with GitHub-script in the workflow. However, I am looking for a solution that does not require manual updates to the workflow file each time a new version is released. To achieve this, I plan to use the following approach:
LATEST_TAG=$(git fetch --tags && git tag --sort=-v:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
This command will automatically fetch all tags, sort them in descending order according to semantic versioning, filter them to match the semantic versioning pattern, and then select the top one as the latest official version tag. ...
Feature Request
Problem Statement
Our current release process does not automatically adjust the latest tag to the most recent official version based on semantic versioning. This limitation arises from our unique git workflow, where:
Proposed Solution
(We have not found existing documentation or capabilities within our current toolset that meet this specific need.Additionally, I'm unsure if my idea above constitutes a valid requirement. I would appreciate some feedback on its viability. If deemed reasonable, I'm willing to implement this feature.)