Skip to content

Commit 91620d4

Browse files
authored
Update telegram_updates.yml (#236)
1 parent 0f016c5 commit 91620d4

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/telegram_updates.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,23 @@ jobs:
8080
fi
8181
8282
elif [[ "$EVENT_NAME" == "pull_request" ]]; then
83-
PR_ACTION="${{ github.event.action }}"
84-
PR_TITLE_RAW="${{ github.event.pull_request.title }}"
85-
PR_URL="${{ github.event.pull_request.html_url }}"
86-
PR_TITLE=$(escape_markdown "$PR_TITLE_RAW")
87-
REPLY='{"inline_keyboard": [[{"text": "View PR", "url": "'"$PR_URL"'"}]]}'
88-
send_message "🔃 *Pull Request $PR_ACTION* by [$ACTOR](https://github.com/$ACTOR):\n• *$PR_TITLE*" "$REPLY"
89-
83+
PR_ACTION="${{ github.event.action }}"
84+
PR_TITLE_RAW="${{ github.event.pull_request.title }}"
85+
PR_URL="${{ github.event.pull_request.html_url }}"
86+
PR_TITLE=$(escape_markdown "$PR_TITLE_RAW")
87+
PR_MERGED="${{ github.event.pull_request.merged }}"
88+
REPLY='{"inline_keyboard": [[{"text": "View PR", "url": "'"$PR_URL"'"}]]}'
89+
if [[ "$PR_ACTION" == "closed" ]]; then
90+
if [[ "$PR_MERGED" == "true" ]]; then
91+
STATUS="*Merged*"
92+
else
93+
STATUS="*Closed without merge*"
94+
fi
95+
send_message "🔃 *Pull Request closed* by [$ACTOR](https://github.com/$ACTOR)\n• $STATUS\n• *$PR_TITLE*" "$REPLY"
96+
else
97+
send_message "🔃 *Pull Request $PR_ACTION* by [$ACTOR](https://github.com/$ACTOR):\n• *$PR_TITLE*" "$REPLY"
98+
fi
99+
90100
elif [[ "$EVENT_NAME" == "release" ]]; then
91101
REL_NAME_RAW="${{ github.event.release.name }}"
92102
REL_URL="${{ github.event.release.html_url }}"

0 commit comments

Comments
 (0)