Skip to content

spes: Update for v1.2 #14

spes: Update for v1.2

spes: Update for v1.2 #14

Workflow file for this run

name: Pull Request Notifier
on:
pull_request_target:
types:
- opened
jobs:
pull_req:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Get Info
run: |
sudo apt-get install jq -y &> /dev/null
echo "PR_TITLE=$(jq --raw-output .pull_request.title ${GITHUB_EVENT_PATH})" >> ${GITHUB_ENV}
echo "PR_URL=$(jq --raw-output .pull_request.html_url ${GITHUB_EVENT_PATH})" >> ${GITHUB_ENV}
- name: Notify in Telegram
run: |
TgNotify() {
local response=$(curl -s -X POST "https://api.telegram.org/bot${{ secrets.BOT_TOKEN }}/sendMessage" \
-d chat_id="${{ secrets.PRIV_CHAT_ID }}" \
-d parse_mode=Markdown \
-d text="${1}" \
-d disable_web_page_preview=true)
local message_id=$(echo "${response}" | jq -r '.result.message_id')
curl -s -X POST "https://api.telegram.org/bot${{ secrets.BOT_TOKEN }}/pinChatMessage" \
-d chat_id="${{ secrets.PRIV_CHAT_ID }}" \
-d message_id="${message_id}"
}
TgNotify "
#PULL\_REQ
*New Pull Request Opened at* [${{ github.repository }}](https://github.com/${{ github.repository }})
*Title:* \`${PR_TITLE}\`
*User:* [${{ github.actor }}](https://github.com/${{ github.actor }})
*Pull Req URL:* [Here](${PR_URL})"