Issue notification (@Sheridan) #36
This file contains hidden or 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 on Issue | |
| run-name: Issue notification (@${{ github.actor }}) | |
| on: | |
| issues: | |
| types: [opened, closed] | |
| jobs: | |
| notify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send issue information to Telegram | |
| run: | | |
| ISSUE_URL="${{ github.event.issue.html_url }}" | |
| TITLE="${{ github.event.issue.title }}" | |
| USER="${{ github.event.issue.user.login }}" | |
| ACTION="${{ github.event.action }}" | |
| if [ "$ACTION" = "opened" ] | |
| then | |
| MESSAGE="🔔 New [Issue](${ISSUE_URL}) opened by ${USER} with title: \`${TITLE}\`" | |
| else | |
| MESSAGE="✅ [Issue](${ISSUE_URL}) closed by ${USER} (Title: \`${TITLE}\`)" | |
| fi | |
| curl -s -X POST \ | |
| "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" \ | |
| -d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \ | |
| -d parse_mode="Markdown" \ | |
| --data-urlencode text="$MESSAGE" |