因为发现TG机器人推送内容包含'xxx.xxx.xxx.xxx'时会推送失败,故改为'xxx,xxx,xxx,xxx'以英文逗号形式输出ip地址。
'HOSTLOC_USERNAME' 用户名,多个用','英文逗号隔开
'HOSTLOC_PASSWORD' 密码,多个用','英文逗号隔开,与用户名一一对应,不对应和上下数量不一致会报错。
'BOT_API' TG机器人的API
'CHAT_ID' 你自己的chat_id
左边的删除,然后写入
name: 'HostlocAutoGetPoints'
on:
push:
branches:
- main
schedule:
- cron: '0 16 * * *'
jobs:
get_points:
runs-on: ubuntu-latest
steps:
- name: 'Checkout codes'
uses: actions/checkout@v2
- name: 'Set python'
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: 'Install dependencies'
run: python -m pip install --upgrade requests pyaes
- name: 'Get points'
env:
HOSTLOC_USERNAME: ${{ secrets.HOSTLOC_USERNAME }}
HOSTLOC_PASSWORD: ${{ secrets.HOSTLOC_PASSWORD }}
BOT_API: ${{ secrets.BOT_API }}
CHAT_ID: ${{ secrets.CHAT_ID }}
run: python HostlocGetPoints.py
设置好Actions secrets后就可以在Action中运行了。如不运行在库中进行任意提交触发Action即可