Unfollower Tracer #45
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Unfollower Tracer | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 22 * * *" | |
permissions: | |
contents: write | |
jobs: | |
build: | |
if: ${{ !(github.repository == '1012796366/unfollower_tracer' && github.event_name == 'schedule') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Python 环境构建' | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: '安装依赖' | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install -r ./requirements.txt | |
- name: '运行 Python' | |
run: | | |
python3 main.py | |
- name: '检查更新' | |
run: | | |
git fetch | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "skip_commit=true" >> $GITHUB_ENV | |
else | |
echo "skip_commit=false" >> $GITHUB_ENV | |
fi | |
- name: '推送' | |
if: ${{ env.skip_commit == 'false' }} | |
run: | | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git add . | |
git commit -m "关注列表更新" | |
git push |