Drive Sign-in #444
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: Drive Sign-in | |
on: | |
schedule: | |
- cron: '2 0 * * *' | |
workflow_dispatch: | |
jobs: | |
sign_in: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
sudo timedatectl set-timezone Asia/Shanghai | |
- name: Run sign-in script | |
run: python main.py | |
env: | |
ALI_REFRESH_TOKEN: ${{ secrets.ALI_REFRESH_TOKEN }} | |
TY_USER: ${{ secrets.TY_USER }} | |
TY_PWD: ${{ secrets.TY_PWD }} | |
YOUDAO_COOKIE: ${{ secrets.YOUDAO_COOKIE }} | |
PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }} | |
SERVERCHAN_SENDKEY: ${{ secrets.SERVERCHAN_SENDKEY }} | |
WECOM_TOKENS: ${{ secrets.WECOM_TOKENS }} | |
WECOM_WEBHOOK: ${{ secrets.WECOM_WEBHOOK }} | |
BARK_DEVICEKEY: ${{ secrets.BARK_DEVICEKEY }} | |
FEISHU_DEVICEKEY: ${{ secrets.FEISHU_DEVICEKEY }} | |
YOUDAO_USER: ${{ secrets.YOUDAO_USER }} | |
REDIS_INFO: ${{ secrets.REDIS_INFO }} | |
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
AMAP_KEY: ${{ secrets.AMAP_KEY }} | |
- name: Commit and push if there are changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "jinde98" | |
if [ -f "screenshot_after_login.png" ]; then | |
git add screenshot_after_login.png | |
git commit -m "Add screenshot" -a || exit 0 # 如果没有更改,退出 | |
git push | |
else | |
echo "screenshot_after_login.png does not exist, skipping commit and push." | |
fi |