Add Heroku support (#1)
* Create Procfile * Create config.py * Create runtime.txt * Create app.json * Add "Deploy to Heroku" button to README.md Co-authored-by: Dash Eclipse <dashezup@disroot.org>
This commit is contained in:
committed by
Dash Eclipse
parent
d3dc14977b
commit
bdfc0135eb
@@ -15,6 +15,10 @@ conflicts.
|
|||||||
3. Format and send the text to a Telegram chat through "sendMessage" method of
|
3. Format and send the text to a Telegram chat through "sendMessage" method of
|
||||||
Telegram Bot API (`GET` request)
|
Telegram Bot API (`GET` request)
|
||||||
|
|
||||||
|
### Heroku
|
||||||
|
|
||||||
|
[](https://heroku.com/deploy?template=https://github.com/dashezup/github-webhook-to-telegram)
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
You need a Telegram bot token, create a Telegram bot with
|
You need a Telegram bot token, create a Telegram bot with
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "GitHub Webhook to Telegram",
|
||||||
|
"description": "Receive GitHub webhook events and send to Telegram chats with AIOHTTP through Telegram Bot API",
|
||||||
|
"repository": "https://github.com/dashezup/github-webhook-to-telegram",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"webhooks",
|
||||||
|
"telegram",
|
||||||
|
"aiohttp",
|
||||||
|
"python",
|
||||||
|
"telegram-bot",
|
||||||
|
"telegram-bot-api"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"HOOK_CONFIG": {
|
||||||
|
"description": "configuration in JSON format, check README and config_sample.json",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,10 +3,11 @@ from os import environ
|
|||||||
|
|
||||||
if environ.get('DYNO'):
|
if environ.get('DYNO'):
|
||||||
data = json.loads(environ.get("HOOK_CONFIG"))
|
data = json.loads(environ.get("HOOK_CONFIG"))
|
||||||
|
PORT = int(environ.get('PORT'))
|
||||||
else:
|
else:
|
||||||
with open("config.json") as f:
|
with open("config.json") as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
PORT = data.get('port')
|
||||||
|
|
||||||
BOT_TOKEN = data['bot_token']
|
BOT_TOKEN = data['bot_token']
|
||||||
PORT = data.get('port')
|
|
||||||
GH_WEBHOOKS = data['gh_webhooks']
|
GH_WEBHOOKS = data['gh_webhooks']
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
python-3.9.4
|
||||||
Reference in New Issue
Block a user