Skip to content

Commit

Permalink
Fix ESR check to check for a newer remote branch instead of an increm…
Browse files Browse the repository at this point in the history
…ent (#3314)

* Fix ESR check to check for a newer remote branch instead of an increment

* Fix for major version
  • Loading branch information
devinbinnie authored Feb 11, 2025
1 parent f00dd62 commit d8ff162
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/patch_updater_yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

VERSION="$(jq -r '.version' <package.json)"
STABLE_VERSION="$(./node_modules/.bin/semver $VERSION -c)"
STABLE_VERSION="$(npx semver $VERSION -c)"
RELEASE_VERSION="${VERSION/$STABLE_VERSION/}"
RELEASE_VERSION="${RELEASE_VERSION/-/}"
RELEASE_VERSION="${RELEASE_VERSION%.*}"
Expand All @@ -11,8 +11,11 @@ if [ "$RELEASE_VERSION" == "" ]; then
RELEASE_VERSION="latest"
fi

# If we are on a ESR branch, we don't want to generate the auto-updater yml for patch releases
if [ -e .esr ] && [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[1-9][0-9]* ]]; then
# If we are on a ESR branch, we don't want to generate the auto-updater yml if there is a newer version
NEXT_MINOR_VERSION="$(npx semver $STABLE_VERSION -i minor)"
NEXT_MAJOR_VERSION="$(npx semver $STABLE_VERSION -i major)"
NEWER_VERSION_EXISTS="$(git ls-remote --tags origin v${NEXT_MINOR_VERSION} v${NEXT_MAJOR_VERSION})"
if [ -e .esr ] && [ ! -z "$NEWER_VERSION_EXISTS" ]; then
echo "ESR branch, skipping auto-updater yml generation"
rm ./release/"${RELEASE_VERSION}"*.yml
exit 0
Expand Down

0 comments on commit d8ff162

Please sign in to comment.