Skip to content

Commit

Permalink
feat: improve the flow to notificate a new releases
Browse files Browse the repository at this point in the history
  • Loading branch information
lfbarrile01 committed Dec 17, 2024
1 parent 692dd3d commit 7995ee7
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/notification.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: Notification

on:
pull_request:
#branches:
#- develop
types:
- opened
- edited
- synchronize
- reopened
push:
branches:
- develop
- main

permissions:
id-token: write
Expand Down Expand Up @@ -45,6 +41,17 @@ jobs:
RAW_RELEASE=$(gh release list --repo $GITHUB_REPOSITORY --limit 1 --json tagName --jq '.[0].tagName')
echo "Raw release: $RAW_RELEASE"
echo "tag=${RAW_RELEASE}" >> $GITHUB_ENV
# Definir a mensagem com base na branch
- name: Set Message for Slack Notification
id: set_message
run: |
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
echo "message=🎉 *Nova Release na branch main* \n \n <https://github.com/${{ github.repository }}/releases/tag/${{ env.tag }} | *Clique aqui para detalhes*>" >> $GITHUB_ENV
elif [[ "${GITHUB_REF}" == "refs/heads/develop" ]]; then
echo "message=🚀 *Nova Release na branch develop* \n \n <https://github.com/${{ github.repository }}/releases/tag/${{ env.tag }} | *Clique aqui para detalhes*>" >> $GITHUB_ENV
fi
# Notificar o Slack sobre nova release
- name: Notify Slack of New Release
Expand Down

0 comments on commit 7995ee7

Please sign in to comment.