check-imagedl.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: daily imagedl check
  2. on:
  3. schedule:
  4. - cron: "0 1 * * *"
  5. workflow_dispatch: {}
  6. permissions:
  7. contents: write
  8. jobs:
  9. check-imagedl:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout repo
  13. uses: actions/checkout@v4
  14. with:
  15. fetch-depth: 0
  16. - name: Set up Python
  17. uses: actions/setup-python@v5
  18. with:
  19. python-version: "3.10"
  20. - name: Install dependencies
  21. run: |
  22. python -m pip install --upgrade pip
  23. pip install git+https://github.com/CharlesPikachu/imagedl.git@main
  24. # env:
  25. # SOME_API_KEY: ${{ secrets.SOME_API_KEY }}
  26. - name: Run imagedl daily check
  27. run: |
  28. python scripts/quick_check_imagedl.py
  29. - name: Commit and push daily_test_results
  30. env:
  31. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  32. AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
  33. AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
  34. run: |
  35. git config user.name "github-actions[bot]"
  36. git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
  37. git add daily_test_results
  38. if git diff --cached --quiet; then
  39. echo "No changes to commit"
  40. else
  41. git commit -m "Update imagedl check $(date -u '+%Y-%m-%d %H:%M:%S')" --author="${AUTHOR_NAME} <${AUTHOR_EMAIL}>"
  42. git push
  43. fi