Fix auto-detection of latest package version#245
Open
stracker-phil wants to merge 7 commits into
Open
Conversation
tyrann0us
reviewed
May 6, 2026
Member
tyrann0us
left a comment
There was a problem hiding this comment.
Please update the documentation, which still states that we are fetching the last tag from the repository, whereas it is now the last release.
Biont
requested changes
May 7, 2026
Member
Biont
left a comment
There was a problem hiding this comment.
Thanks for this. I believe this was the correct approach all the time. I was "emotionally" in favor of a git-only (no gh cli) approach when I built this, but given that we are in the context of GitHub Actions, there's just no reason not to commit to their tooling.
IMO we can remove the fallback as per https://github.com/inpsyde/reusable-workflows/pull/245/changes#r3196373868 - then we are golden
New logic extracts the first tag that does not have a "/" in it and starts with a digit, or the letter "v" followed by a digit
Keep the existing tag based logic as fallback if the release API fails for some reason
7ac3d00 to
37fbc05
Compare
tyrann0us
approved these changes
May 21, 2026
Member
tyrann0us
left a comment
There was a problem hiding this comment.
Thank you for working on this! LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix
What is the current behavior? (You can also link to an open issue here)
The automatically determined
PACKAGE_VERSIONdefaulted to the most recently created git tag, regardless of whether that tag represented an actual release version or something else (e.g. arbitrary non-semver tags such asarchive/qa-legacy-ui-tests).This caused two problems downstream, where
PACKAGE_VERSIONis consumed:PACKAGE_VERSIONinto asedexpression that uses/as its delimiter; a slash in the tag breaks the substitution with an error.package.json(vianpm version, which rejects them) andcomposer.json(viajq, which accepts any string), corrupting the build artifact.What is the new behavior (if this is a feature change)?
The workflow now fetches the tag name of an actual GitHub Release via
gh release list, so only published releases are considered.Assumption: A release tag represents a valid semantic version and never contains slashes, e.g.
4.0.34.0.3-alpha-2026-05-06v2.17.0Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
The "0.0.0" fallback already existed previously, but it now triggers in more cases: any repository that has tags but no published GitHub Release will fall back to "0.0.0" instead of picking up a tag.
This will not block the build, but it will insert a "0.0.0"-based version string into project files in the following steps:
package.jsoncomposer.jsonOther information
Repositories that previously relied on tags being picked up without ever cutting a GitHub Release should publish a Release to keep getting a meaningful version prefix.
npm versionrequirementsThe workflow constructs
PACKAGE_VERSIONand validates it against semver vianpm versionin the "Update version in package.json" step. This means, theLATEST_RELEASEstring itself must match the following pattern to pass this check:Valid samples:
1.2.3v1.2.31.2.3-alpha1.2.3-feature.11.2.3-2026-05-21Invalid samples:
1.2→ missing PATCH1.2.3.4→ too many segments1.2.3-→ empty identifierv.1.2.3→ dot after va.b.c→ non-numeric segments