Skip to content

Commit

Permalink
Add safety check in workflow for version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed Sep 5, 2024
1 parent ac5f940 commit 227afb3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ jobs:
if [ "${{ github.event.inputs.increase-major }}" == "Yes" ]; then
VMAJOR=$[$VMAJOR+1]
echo "Increase major version to $VMAJOR"
if [ $VMAJOR -gt 9 ]; then
echo "::error title=Invalid version::The major version needs to be one digit!"
exit 1
fi
fi
echo "VMAJOR=$VMAJOR" >> $GITHUB_ENV
- name: Bump version number and release years
run: |
sed -i -r "s/(^export RYEARS=[0-9]{4}-)[0-9]{4}$/\1$(date +'%Y')/" metadata
sed -i -r "s/(^export VMAJOR=)[0-9]+$/\1${{ env.VMAJOR }}/" metadata
sed -i -r "s/(^export VMAJOR=)-?[0-9]+$/\1${{ env.VMAJOR }}/" metadata
sed -i -r "s/(^export VMINOR=)[0-9]+$/\1${{ env.VMINOR }}/" metadata
sed -i -r "s/(^export IKARUS_VERSION=)[0-9]+$/\1${{ env.VIKARUS_NEW }}/" metadata
sed -i -r "s/(^export LEGO_N_VERSION=)[0-9]+$/\1${{ env.VLEGO_NEW }}/" metadata
Expand Down

0 comments on commit 227afb3

Please sign in to comment.