Skip to content

Commit

Permalink
modifications done on actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Figeral committed Apr 1, 2024
1 parent 81ed868 commit 866a6f3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/notify_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: ["master"]

jobs:
build:
notify:
runs-on: ubuntu-latest

steps:
Expand All @@ -25,6 +25,11 @@ jobs:
run: |
python3 -m pip install -r .github/workflows/requirements.txt
- name : running script
- name : running script
env:
TELEGRAM_BOT_TOKEN: ${{secrets.TELEGRAM_BOT_TOKEN}}
USER_ID: ${{secrets.FITZ_ID}}
GITHUB_REPOSITORY: ${{github.repository}}
GitHUB_EVENT_AUTHOR: ${{github.event.pusher.username}}
run: |
python3 .github/workflows/source/index.py
15 changes: 11 additions & 4 deletions .github/workflows/source/index.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import requests
import os


def send_mgs():
token = "bot6544277286:AAHSPQdHgM8YIKVQM0fGJzXXN04iudE3pNg"
url = f"https://api.telegram.org/{token}/sendMessage"
user_id = 5429946779
msg = f"A {github.event.type} made by {github.event.sender.login} , feel free to edit it at {github.repository.html_url}"
token = os.environ['TELEGRAM_BOT_TOKEN']
user_id = os.environ['USER_ID']
repository = os.environ['GITHUB_REPOSITORY']
author = os.environ['GITHUB_EVENT_AUTHOR']

baseUrl = "https://api.telegram.org"
url = f"{baseUrl}/bot{token}/sendMessage"
link = f"github.com/Figeral/{repository}"

msg = f"A Pushed 🚀 made by {author} \n feel free to edit it at {link}"
payload = dict(chat_id=user_id, text=msg)
requests.post(url=url, params=payload)

Expand Down

0 comments on commit 866a6f3

Please sign in to comment.