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 2d507f0
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 @@ -53,6 +53,8 @@ jobs:
uses: actions/github-script@v7
with:
script: |
if (( ${{env.MAIN_GALAXY_VERSION}} >= ${{env.CURRENT_GALAXY_VERSION}} )); then
# Bash semver compare script from https://stackoverflow.com/a/37939589
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 2d507f0

Please sign in to comment.