From a6d8c91b26cf1798734a8be3eb068ffbe0dc8650 Mon Sep 17 00:00:00 2001 From: Van-Dev Date: Thu, 21 Mar 2024 22:42:23 +0700 Subject: [PATCH] fix: wrong branch push --- ...etAndCheckProxies.yaml => checkProxy.yaml} | 34 +++---------- .github/workflows/getProxy.yaml | 48 +++++++++++++++++++ 2 files changed, 54 insertions(+), 28 deletions(-) rename .github/workflows/{getAndCheckProxies.yaml => checkProxy.yaml} (66%) create mode 100644 .github/workflows/getProxy.yaml diff --git a/.github/workflows/getAndCheckProxies.yaml b/.github/workflows/checkProxy.yaml similarity index 66% rename from .github/workflows/getAndCheckProxies.yaml rename to .github/workflows/checkProxy.yaml index 63f261b93c..ac8ef08c52 100644 --- a/.github/workflows/getAndCheckProxies.yaml +++ b/.github/workflows/checkProxy.yaml @@ -1,40 +1,18 @@ name: Check and push proxies on: - schedule: - - cron: '0 */3 * * *' - push: - branches: + workflow_run: + workflows: + - Get Proxies and push proxies + branches: - main + types: + - completed permissions: contents: write jobs: - get_proxies: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - - - name: Get HTTP proxies - run: | - python3 proxyScraper.py -t 20 -s http -o proxies/http.txt - - - name: Get HTTPS proxies - run: | - python3 proxyScraper.py -t 20 -s https -o proxies/https.txt - test_proxies: runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/getProxy.yaml b/.github/workflows/getProxy.yaml new file mode 100644 index 0000000000..6a2e2fc792 --- /dev/null +++ b/.github/workflows/getProxy.yaml @@ -0,0 +1,48 @@ +name: Get Proxies and push proxies + +on: + schedule: + - cron: '0 */3 * * *' + push: + branches: + - main + +permissions: + contents: write + +jobs: + get_proxies: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + + - name: Getting proxies + run: | + python3 proxyScraper.py -p http -o proxies/http.txt + python3 proxyScraper.py -p https -o proxies/https.txt + python3 proxyScraper.py -p socks4 -o proxies/socks4.txt + python3 proxyScraper.py -p socks5 -o proxies/socks5.txt + + - name: Commit + run: | + git config --global user.email ${{ secrets.GIT_EMAIL }} + git config --local user.name ${{ secrets.GIT_NAME }} + git commit -am "feat: update proxies" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + env: + CI: true \ No newline at end of file