Skip to content

Commit

Permalink
Use intermediate env var for input version
Browse files Browse the repository at this point in the history
  • Loading branch information
pdil committed Mar 31, 2024
1 parent 468b5a9 commit c87702f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ jobs:
uses: actions/checkout@v4

- name: Check version number
env:
INPUT_VERSION: ${{ inputs.version }}
run: |
current_version=$(echo "$(cat DESCRIPTION)" | grep "Version:" | awk '{print $2}')
input_version="${{ inputs.version }}"
CURRENT_VERSION=$(echo "$(cat DESCRIPTION)" | grep "Version:" | awk '{print $2}')
if [ "$(printf '%s\n' "$input_version" "$current_version" | sort -V | head -n1)" = "$input_version" ]; then
echo "::error title=Invalid version::Provided version number must be higher than the current version ($current_version)."
if [ "$(printf '%s\n' "$INPUT_VERSION" "$CURRENT_VERSION" | sort -V | head -n1)" = "$INPUT_VERSION" ]; then
echo "::error title=Invalid version::Provided version number must be higher than the current version ($CURRENT_VERSION)."
exit 1
fi
Expand Down

0 comments on commit c87702f

Please sign in to comment.