Skip to content

Commit

Permalink
telegram action done
Browse files Browse the repository at this point in the history
  • Loading branch information
Figeral committed Apr 1, 2024
1 parent 4ef02e1 commit cc9c4de
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/notify_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name : running script
cache: 'pip'

- name : running script
run: |
ls
python -m pip install request
python3 .github/workflows/source/index.py
15 changes: 14 additions & 1 deletion .github/workflows/source/index.py
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
print("hello world")
import requests


def send_mgs():
token = "bot${{secrets.TELEGRAM_BOT_TOKEN}}"
url = f"https://api.telegram.org/{token}/sendMessage"
user_id = "${{secrets.FITZ_ID}}"
msg = "A ${{github.event.type}} made by ${{github.event.author}} , fille free to edit it at ${{github.repository.html_url}}"
payload = dict(chat_id=user_id, text=msg)
requests.post(url=url, params=payload)


if __name__ == "__main__":
send_mgs

0 comments on commit cc9c4de

Please sign in to comment.