update proxies.json #1895
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 proxies.json | |
| on: | |
| schedule: | |
| - cron: "0 */3 * * *" | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Set Up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests | |
| - name: Update Proxies | |
| run: python scripts/update_proxies.py | |
| - name: Commit Changes If Any | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
| AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
| run: | | |
| if git diff --quiet proxies.json; then | |
| echo "No changes in proxies.json" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add proxies.json | |
| git commit -m "Update proxies.json [skip ci]" --author="${AUTHOR_NAME} <${AUTHOR_EMAIL}>" | |
| git push |