diff --git a/.github/workflows/check-version.yml b/.github/workflows/check-version.yml index 22d4170..88819c7 100644 --- a/.github/workflows/check-version.yml +++ b/.github/workflows/check-version.yml @@ -10,6 +10,18 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Compare version + - name: Set OLD_VERSION from etc/config.xml if merge would modify it run: | - [[ "$(cat ./etc/config.xml | grep \ | sed -e 's/\(.*\)<\/version>/\1/' | tr -d '[:blank:]')" == $(curl -s https://raw.githubusercontent.com/TrueLayer/magento2/refs/heads/main/etc/config.xml | grep \ | sed -e 's/\(.*\)<\/version>/\1/' | tr -d '[:blank:]') ]] + echo "OLD_VERSION=$(git log main.. --cherry -p -- etc/config.xml | grep '\-.\s*.\' | tr -d '\-[:blank:]\n' | sed -e 's/\(.*\)<\/version>/\1/')" >> $GITHUB_ENV + + - name: Set NEW_VERSION from etc/config.xml if merge would modify it + run: | + echo "NEW_VERSION=$(git log main.. --cherry -p -- etc/config.xml | grep '\+.\s*.\' | tr -d '+[:blank:]\n' | sed -e 's/\(.*\)<\/version>/\1/')" >> $GITHUB_ENV + + - name: Test that versions are not empty + run: | + [[ ! -z $OLD_VERSION ]] && [[ ! -z $NEW_VERSION ]] + + - name: Test that versions are different + run: | + [[ $OLD_VERSION != $NEW_VERSION ]]