Skip to content

Commit

Permalink
PullReqNotifier: Initial commit [skip ci]
Browse files Browse the repository at this point in the history
Change-Id: I83c5709b4f4deeedce7e339a8c3514a5f713b3f7
Signed-off-by: PrajjuS <[email protected]>
  • Loading branch information
PrajjuS committed Sep 15, 2024
1 parent 71d31f3 commit c0d3b37
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/pr_notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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() {
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
}
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})"

0 comments on commit c0d3b37

Please sign in to comment.