fallback to version in package json

This commit is contained in:
2026-03-14 18:15:33 +01:00
parent 69fe519f7a
commit c5cd0f0430
2 changed files with 10 additions and 10 deletions

View File

@@ -83,6 +83,8 @@ runs:
}
resolve_release_line() {
local package_version
if [[ -n "${INPUT_RELEASE_LINE}" ]]; then
if ! validate_release_line "${INPUT_RELEASE_LINE}"; then
echo "Invalid release_line input '${INPUT_RELEASE_LINE}'. Expected format: <major>.<minor>" >&2
@@ -102,16 +104,13 @@ runs:
return 0
fi
if [[ "${BRANCH}" == "develop" ]]; then
local package_version
package_version="$(read_package_version)"
if [[ "${package_version}" =~ ^([0-9]+)\.([0-9]+)\.[0-9]+([-.].*)?$ ]]; then
echo "${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
return 0
fi
package_version="$(read_package_version)"
if [[ "${package_version}" =~ ^([0-9]+)\.([0-9]+)\.[0-9]+([-.].*)?$ ]]; then
echo "${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
return 0
fi
echo "Unable to determine release line for branch '${BRANCH}'. Use release/<major>.<minor>, run in a PR targeting such a branch, or provide inputs.release_line." >&2
echo "Unable to determine release line for branch '${BRANCH}'. Use release/<major>.<minor>, provide inputs.release_line, or ensure package.json contains a semantic version." >&2
exit 1
}