Fetch Fan #7756
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: Fetch Fan | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '5 */4 * * *' | |
| jobs: | |
| run_python_script: | |
| 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 | |
| - name: Install dependencies | |
| run: pip install requests | |
| - name: Run Python script | |
| run: python ./fan.py | |
| - id: check | |
| name: Check for changes | |
| run: | | |
| if git diff-index --quiet HEAD --; then | |
| echo "No changes detected. Skipping commit." | |
| exit 0 | |
| fi | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| git add . | |
| git commit -m "update" | |
| - name: Push changes | |
| if: steps.check.conclusion == 'success' | |
| uses: ad-m/github-push-action@master | |
| with: | |
| # github_token: ${{ secrets.TOKEN }} | |
| branch: main |