Notify Telegram on Release #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Notify Telegram on Release | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
notify: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Format release date | |
id: format_date | |
run: | | |
RELEASE_DATE=$(date -d "${{ github.event.release.created_at }}" +"%d-%m-%Y") | |
echo "release_date=$RELEASE_DATE" >> $GITHUB_ENV | |
- name: Check release description | |
id: check_description | |
run: | | |
if [ -z "${{ github.event.release.body }}" ]; then | |
echo "description=No description provided" >> $GITHUB_ENV | |
else | |
echo "description=${{ github.event.release.body }}" >> $GITHUB_ENV | |
fi | |
- name: Send Telegram notification | |
uses: appleboy/telegram-action@master | |
with: | |
token: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
to: ${{ secrets.TELEGRAM_CHAT_ID }} | |
message: | | |
Nova atualização publicada! | |
Data: ${{ env.release_date }} | |
Versão: ${{ github.event.release.tag_name }} | |
Descrição: ${{ env.description }} | |
Link: https://github.com/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }} | |
Link do Source: https://api.github.com/repos/${{ github.repository }}/zipball/${{ github.event.release.tag_name }} | |
#CHANGELOG_V1.X |