-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.11 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Sync Hourly
on:
# push:
# branches:
# - main
schedule:
- cron: '0 * * * *' # Hourly
workflow_dispatch:
repository_dispatch:
types: [sync-hourly]
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Fetch hot daily api
run: |
python fetch_hot_daily_api.py
python format_tg_markdownv2.py > formatted_text.txt
- name: Format to MarkdownV2
run: |
{
echo 'FORMATTED_TEXT<<EOF'
cat formatted_text.txt
echo EOF
} >> "$GITHUB_ENV"
- name: Post Text
uses: xireiki/channel-post@v1
with:
bot_token: ${{ secrets.BOT_TOKEN }}
chat_id: ${{ secrets.CHAT_ID }}
context: ${{ env.FORMATTED_TEXT }}
parse_mode: HTML # Optional
method: sendMessage