Baidu Tieba Auto Sign #880
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Baidu Tieba Auto Sign' | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '15 0 * * *' | |
- cron: '0 1 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' # 使用适当的 Python 版本 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests # requests 模块 | |
- name: Run check-in | |
run: | | |
python main.py --login_cookie "$LOGIN_COOKIE" --auth_cookie "$AUTH_COOKIE" >> run.log | |
env: | |
LOGIN_COOKIE: ${{ secrets.LOGIN_COOKIE }} | |
AUTH_COOKIE: ${{ secrets.AUTH_COOKIE }} | |
- name: Append Success Log #追加成功日志 | |
run: | | |
echo "$(date +%Y-%m-%d\ %H:%M:%S) - 签到成功" >> run.log | |
- name: Upload log #上传日志 | |
uses: actions/upload-artifact@v2 | |
with: | |
name: logs | |
path: run.log | |
- name: Push log #更新日志 | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: auto-checkin | |
branch: main |