diff --git a/.github/workflows/deploy-java.yml b/.github/workflows/deploy-java.yml index dd8cd0b..26d1682 100644 --- a/.github/workflows/deploy-java.yml +++ b/.github/workflows/deploy-java.yml @@ -39,13 +39,13 @@ jobs: git fetch origin main LAST_VERSION=$(git show origin/main:integrations/java/pom.xml | grep -m1 '' | sed -E 's/.*([^<]+)<\/version>.*/\1/') echo "LAST_VERSION: $LAST_VERSION" - if [ "$LAST_VERSION" == "$VERSION" ]; then - echo "Version did not change. Exiting..." + if [ -z "$LAST_VERSION" ] || [ "$LAST_VERSION" == "$VERSION" ]; then + echo "Version did not change or no previous version found. Skipping deployment." exit 0 fi - name: Build and deploy - if: steps.version_check.outputs.VERSION != steps.get_version.outputs.VERSION + if: steps.version_check.outputs.LAST_VERSION != steps.get_version.outputs.VERSION || steps.version_check.outputs.LAST_VERSION == "" run: | mvn -f integrations/java/pom.xml deploy \ -DskipTests \