Skip to content

V2Ray Auto Config

V2Ray Auto Config #994

Workflow file for this run

name: V2Ray Auto Config
on:
workflow_dispatch:
schedule:
- cron: '0 */9 * * *'
permissions:
contents: write
jobs:
scrape-and-commit:
runs-on: ubuntu-latest
steps:
- name: 📥 Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: 🐍 Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
- name: ⚙️ Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r Files/requirements.txt
- name: 📂 Check input files
run: |
echo "Checking urls.txt:"
cat Files/urls.txt || echo "urls.txt not found"
echo "Checking key.json:"
cat Files/key.json || echo "key.json not found"
echo "Checking proxy_scraper.py:"
ls -la Files/proxy_scraper.py || echo "proxy_scraper.py not found"
- name: 🕸️ Run scraping script
run: |
python Files/proxy_scraper.py || { echo "Scraper failed, check logs"; exit 1; }
- name: 📂 Check directory contents
run: |
echo "Listing repository contents:"
ls -R
echo "Checking for configs:"
ls -la configs/ || echo "configs does not exist or is empty"
echo "Checking for proxy_output:"
ls -la proxy_output/ || echo "proxy_output does not exist or is empty"
echo "Checking for README.md:"
ls -la README.md || echo "README.md does not exist"
- name: 🛠️ Create configs if not exists
run: |
mkdir -p configs
touch configs/.gitkeep
echo "Created configs/.gitkeep"
- name: 🔧 Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: ⬆️ Commit and Push Changes
run: |
git add configs/ proxy_output/ README.md || true
if git diff --staged --quiet; then
echo "No changes detected. Skipping commit."
else
echo "Changes detected. Committing..."
git commit -m "♻️: Update configs & proxy_output files 🤖 [skip ci]"
git fetch origin
git pull --rebase origin main || { echo "Rebase failed"; git rebase --abort; exit 1; }
git push origin main || { echo "Push failed"; exit 1; }
fi
- name: 📦 Upload proxy files to Releases
uses: softprops/action-gh-release@v3
if: github.event_name != 'pull_request'
with:
tag_name: latest-proxy-update
name: Latest Proxy Lists
body: |
Updated at: ${{ github.event.repository.updated_at }}
Generated by Proxy Scraper
files: |
proxy_output/SOCKS5.txt
proxy_output/SOCKS4.txt
proxy_output/HTTPS.txt
Files/requirements.txt
draft: false
prerelease: false
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}