fan.yaml 986 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. name: Fetch Fan
  2. on:
  3. workflow_dispatch:
  4. schedule:
  5. - cron: '5 */4 * * *'
  6. jobs:
  7. run_python_script:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout code
  11. uses: actions/checkout@v2
  12. - name: Set up Python
  13. uses: actions/setup-python@v2
  14. with:
  15. python-version: 3.x
  16. - name: Install dependencies
  17. run: pip install requests
  18. - name: Run Python script
  19. run: python ./fan.py
  20. - id: check
  21. name: Check for changes
  22. run: |
  23. if git diff-index --quiet HEAD --; then
  24. echo "No changes detected. Skipping commit."
  25. exit 0
  26. fi
  27. git config --global user.name "GitHub Actions"
  28. git config --global user.email "actions@github.com"
  29. git add .
  30. git commit -m "update"
  31. - name: Push changes
  32. if: steps.check.conclusion == 'success'
  33. uses: ad-m/github-push-action@master
  34. with:
  35. # github_token: ${{ secrets.TOKEN }}
  36. branch: main