Skip to content

Commit

Permalink
fix: πŸ› compare only major version to deteremine outdated node (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kusnierz authored Oct 9, 2024
1 parent bf5627c commit e18ed7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions npm-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ runs:
shell: bash
env:
NODE_VERSION: ${{ steps.determine-node-npm-version.outputs.node-version }}
# bash can only compare integers, use 'bc' to compare versions like 18.20. Also remove '.x' wildcards that we commonly use in version
run: echo outdated-node-version=$(echo "${NODE_VERSION//.x/} < 18" | bc) >> $GITHUB_OUTPUT
# remove anything after the first dot from NODE_VERSION and then compare it. 'bc' returns 1 if condition is true
run: echo outdated-node-version=$(echo "${NODE_VERSION//.*/} < 18" | bc) >> $GITHUB_OUTPUT

- if: always() && fromJSON(steps.determine-old-node-version.outputs.outdated-node-version)
name: Comment old NodeJs version
Expand Down

0 comments on commit e18ed7c

Please sign in to comment.