diff --git a/.github/workflows/reusable-check-version.yml b/.github/workflows/reusable-check-version.yml index 6b7d3d6..79bbe30 100644 --- a/.github/workflows/reusable-check-version.yml +++ b/.github/workflows/reusable-check-version.yml @@ -52,7 +52,9 @@ jobs: - name: Compare versions uses: actions/github-script@v7 with: + # Bash semver compare script taken from https://stackoverflow.com/a/37939589 script: | - if (( ${{env.MAIN_GALAXY_VERSION}} >= ${{env.CURRENT_GALAXY_VERSION}} )); then + function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } + if [ $(version ${{env.MAIN_GALAXY_VERSION}}) -ge $(version ${{env.CURRENT_GALAXY_VERSION}}) ]; then core.setFailed('Your Galaxy version is lower than the version in the main branch or equal. Please bump your version!') fi \ No newline at end of file