Skip to content

Commit

Permalink
ci: fix slack notification (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
sahani-deriv authored Jan 23, 2024
1 parent 59f2378 commit f17d85d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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 }}
Expand Down

0 comments on commit f17d85d

Please sign in to comment.