diff --git a/.github/workflows/Bump-Addon-Version-base.yml b/.github/workflows/Bump-Addon-Version-base.yml index af662474..11b451db 100644 --- a/.github/workflows/Bump-Addon-Version-base.yml +++ b/.github/workflows/Bump-Addon-Version-base.yml @@ -22,7 +22,7 @@ jobs: - name: "Retrieve version & increment it" id: version run: | - set -e # Kill script directly on error + set -e echo "Starting version increment process..." configFiles=$(find . -name 'config.yaml' -print0 | xargs -r0 echo) if [[ -z "$configFiles" ]]; then @@ -57,10 +57,14 @@ jobs: ((patch++)) NEW_VERSION="$major.$minor.$patch" echo "🔹 Updating $configfile from $OLD_VERSION to $NEW_VERSION" - sed -i "s/version: $OLD_VERSION/version: $NEW_VERSION/g" "$configfile" || { - echo "❌ Error: Failed to update version in $configfile"; - exit 1; - } + sed -i.bak -E "s/^[[:space:]]*version:[[:space:]]+$OLD_VERSION/ version: $NEW_VERSION/" "$configfile" + NEW_VERSION_CHECK=$(grep -E '^[[:space:]]*version:[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+' "$configfile" | head -1 | awk '{print $2}') + if [[ "$NEW_VERSION_CHECK" != "$NEW_VERSION" ]]; then + echo "❌ Error: Version update failed in $configfile!" + echo "🔍 File content after attempt:" + cat "$configfile" + exit 1 + fi echo "✅ Successfully updated $configfile to version $NEW_VERSION" done echo "🎉 Version increment process completed successfully!"