Skip to content

Commit

Permalink
add working bash semver compare script
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBesson committed Jul 18, 2024
1 parent 5c1fd7d commit 0efd9cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/reusable-check-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0efd9cc

Please sign in to comment.