mirror of
https://github.com/Lifailon/lazyjournal.git
synced 2026-11-11 01:09:46 +01:00
55 lines
2.2 KiB
YAML
55 lines
2.2 KiB
YAML
name: "[PR] PR Telegram notify"
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, synchronize, reopened, closed]
|
|
|
|
run-name: "${{ format('Pull Request #{0}: {1}', github.event.pull_request.number, github.event.pull_request.title) }}"
|
|
|
|
jobs:
|
|
pr_tg_report:
|
|
name: Telegram notification
|
|
|
|
permissions: {}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Send message to Telegram
|
|
id: tg_msg
|
|
uses: appleboy/telegram-action@68ac04bda0e0f4755e24649161566b4b6732cc83 # v1.1.2
|
|
continue-on-error: true
|
|
with:
|
|
token: ${{ secrets.TELEGRAM_API_TOKEN }}
|
|
to: ${{ secrets.TELEGRAM_CHANNEL_ID }}
|
|
debug: true
|
|
format: markdown
|
|
message: |
|
|
🔔 **Action**: ${{ github.event_name }} ${{ github.event.action }} [#${{ github.event.pull_request.number }}](${{ github.event.comment.html_url || github.event.pull_request.html_url }})
|
|
|
|
📁 **Repository**: ${{ github.repository }}
|
|
🌿 **Branch**: ${{ github.event.pull_request.head.ref }} -> ${{ github.event.pull_request.base.ref }}
|
|
👤 **From user**: ${{ github.actor }}
|
|
|
|
📌 **Title**: ${{ github.event.pull_request.title }}
|
|
💬 **Description**:
|
|
${{ github.event.comment.body || github.event.pull_request.body }}
|
|
|
|
- name: Send message to Telegram if there is an error sending the description
|
|
if: failure()
|
|
uses: appleboy/telegram-action@68ac04bda0e0f4755e24649161566b4b6732cc83 # v1.1.2
|
|
continue-on-error: true
|
|
with:
|
|
token: ${{ secrets.TELEGRAM_API_TOKEN }}
|
|
to: ${{ secrets.TELEGRAM_CHANNEL_ID }}
|
|
debug: true
|
|
format: markdown
|
|
message: |
|
|
🔔 **Action**: ${{ github.event_name }} ${{ github.event.action }} [#${{ github.event.pull_request.number }}](${{ github.event.comment.html_url || github.event.pull_request.html_url }})
|
|
|
|
📁 **Repository**: ${{ github.repository }}
|
|
🌿 **Branch**: ${{ github.event.pull_request.head.ref }} -> ${{ github.event.pull_request.base.ref }}
|
|
👤 **From user**: ${{ github.actor }}
|
|
|
|
📌 **Title**: ${{ github.event.pull_request.title }}
|