Skip to content

Issue notification (@Sheridan) #36

Issue notification (@Sheridan)

Issue notification (@Sheridan) #36

Workflow file for this run

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"