update-friends-links #20
This file contains hidden or 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: update-friends-links | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| tags: | |
| - 'v*' | |
| # branches: | |
| # - master | |
| issues: | |
| repository_dispatch: | |
| watch: | |
| types: [started] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event.repository.owner.id == github.event.sender.id # 自己点的 start | |
| permissions: | |
| contents: write # 允许写入仓库内容 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@master | |
| - name: Set up Python #安装python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install requirements #安装requests | |
| run: | | |
| pip install -r ./src/Links/requirements.txt | |
| - name: Update links #更新 | |
| run: | | |
| python ./src/Links/run.py | |
| echo `date +"%Y-%m-%d %H:%M:%S"` begin > ./src/Links/time.log | |
| - name: Commit #更新日志到GitHub仓库 | |
| run: | | |
| git config --global user.email AutoWakeUp@email.com | |
| git config --global user.name AutoWakeUp | |
| git add . | |
| git commit -m "更新友联数据" -a | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |