Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve the flow to notificate a new releases #90

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading