Skip to content

Commit

Permalink
trim the user input vesion to check major
Browse files Browse the repository at this point in the history
  • Loading branch information
gzukel committed Feb 15, 2024
1 parent 879fb47 commit d5495af
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,10 @@ jobs:
if: ${{ github.event.inputs.skip_checks != 'true' }}
run: |
UPGRADE_HANDLER_MAJOR_VERSION=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"' | cut -d '.' -f 1 | tr -d '\n')
echo "Upgrade Handler Major Version: $UPGRADE_HANDLER_MAJOR_VERSION"
echo "User Inputted Release Version: ${{ github.event.inputs.version }}"
if [ ${{ inputs.version }} != $UPGRADE_HANDLER_MAJOR_VERSION ]; then
USER_INPUT_VERSION=$(echo "${{ github.event.inputs.version }}" | cut -d '.' -f 1 | tr -d '\n')
echo "Upgrade Handler Major Version: ${UPGRADE_HANDLER_MAJOR_VERSION}"
echo "User Inputted Release Version: ${USER_INPUT_VERSION}"
if [ ${USER_INPUT_VERSION} != $UPGRADE_HANDLER_MAJOR_VERSION ]; then
echo "ERROR: The input version doesn't match the release handler for the branch selected. Please ensure the upgrade handler of the branch you selected when you ran the pipeline matches the input version."
echo "Did you forget to update the 'releaseVersion' in app/setup_handlers.go?"
exit 1
Expand Down

0 comments on commit d5495af

Please sign in to comment.