From ae483624abbc4a712c57af9dadcd941321dfd34d Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Wed, 19 Jul 2023 23:59:48 +0530 Subject: [PATCH] fix --- .github/workflows/test.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b56373..b83fad5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,11 +24,13 @@ jobs: id: tag shell: bash run: | - if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then - if [[ -z ${{ inputs.tag }} ]]; then + event=${{ github.event_name }} + if [[ $event == 'workflow_dispatch' ]]; then + if [[ -z '${{ inputs.tag }}' ]]; then tag=$(curl -s https://releases.rocket.chat/rc/info | jq .tag -r) - else - [[ -n "$(curl -s https://releases.rocket.chat/${{ inputs.tag }}/info | jq -r '.tag // empty')" ]] + elif [[ -z "$(curl -s https://releases.rocket.chat/${{ inputs.tag }}/info | jq -r '.tag // empty')" ]]; then + echo "::error::invalid tag ${{ inputs.tag }}" + exit 1 fi fi echo "tag: $tag"