Auto Update V2Ray Subscriptions #64
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: Auto Update V2Ray Subscriptions | |
| on: | |
| schedule: | |
| - cron: '0 */12 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.PAT }} | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pip install requests | |
| - name: Run Collector Script | |
| run: python collector.py | |
| - name: Commit and Push | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Добавляем все изменения | |
| git add subs/ README.md | |
| # Если есть изменения — коммитим | |
| if git diff --staged --quiet; then | |
| echo "✅ Нет новых изменений" | |
| else | |
| git commit -m "Auto update: $(date '+%Y-%m-%d %H:%M:%S UTC')" | |
| # Пушим с обработкой конфликтов | |
| git pull --rebase origin main || true | |
| git push | |
| echo "✅ Успешно обновлено и запушено" | |
| fi |