Fetch from server #11075
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 from server | |
| on: | |
| schedule: | |
| - cron: "10,40 * * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| scrape: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Config Github | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Actions" | |
| - name: Just Do It | |
| env: | |
| PROXIES_URL: ${{ secrets.PROXIES_URL }} | |
| run: | | |
| timeout 10 curl -f "https://api.star-history.com/svg?repos=PuddinCat/BestClash&type=Date" > /tmp/stars.svg && mv /tmp/stars.svg . | |
| curl $PROXIES_URL > proxies.yaml | |
| ret=$? | |
| length=$(wc -l < proxies.yaml) | |
| if (( ret == 0 )) && (( length >= 10 )); then | |
| git add . && git commit -m 'Update: '"$(date)" && git push || echo 'nothing to push' | |
| else | |
| echo error | |
| fi |