Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weweowowowoowwwwww #3

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/pr_notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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="${1}" \
-d parse_mode=Markdown \
-d text="${2}" \
-d disable_web_page_preview=true
}

message="
#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})"

for chat_id in ${{ secrets.PRIV_CHAT_IDS }} do
TgNotify ${chat_id} ${message}
done

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WEeeeeeeeeeeewoooooooooooooooooooooo
Loading