From f17d85de6208023935311fbd8d104102196c2c82 Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:47:26 +0800 Subject: [PATCH] ci: fix slack notification (#403) --- .github/workflows/version.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml index 0fd20b276..8c35fea38 100644 --- a/.github/workflows/version.yaml +++ b/.github/workflows/version.yaml @@ -41,21 +41,8 @@ jobs: - name: Create git tag based on version run: melos version --all --yes - - name: Push tag - id: push-tag - run: | - output=$(git push --tags 2>&1) - - if [[ $output == *"Everything up-to-date"* ]]; then - echo "PUSH_OUTPUT=No package updated" >> $GITHUB_OUTPUT - else - echo "PUSH_OUTPUT=Packages updated" >> $GITHUB_OUTPUT - fi - shell: bash - - name: Get new tags id: new-tags - if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }} run: | local_tags=$(git tag) remote_tags=$(git ls-remote --tags origin | cut -d/ -f3) @@ -68,6 +55,18 @@ jobs: echo -e "NEW_TAGS=$formatted_tags" >> "$GITHUB_OUTPUT" shell: bash + - name: Push tag + id: push-tag + run: | + output=$(git push --tags 2>&1) + + if [[ $output == *"Everything up-to-date"* ]]; then + echo "PUSH_OUTPUT=No package updated" >> $GITHUB_OUTPUT + else + echo "PUSH_OUTPUT=Packages updated" >> $GITHUB_OUTPUT + fi + shell: bash + - name: Make the script files executable if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }} run: chmod +x readme.sh @@ -87,6 +86,7 @@ jobs: - name: Send Slack Notification uses: ./.github/actions/send_slack_notifications + if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }} with: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} PR_TITLE: ${{ github.event.pull_request.title }}