Update Lists #11449
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 Lists | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: "update" | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0,30 * * * *' # every 30 minutes | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Update Lists | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # generate lists and update README | |
| make update | |
| # commit generated files back to repo if any changed | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add README.md list/total.svg 2>/dev/null || true | |
| if [ -n "$(git status --porcelain)" ]; then | |
| timestamp=$(date -u +"%Y-%m-%d %H:%M:%S UTC") | |
| git commit -m "chore(list): Updated free proxy list - $timestamp" | |
| # push using token | |
| git push | |
| fi | |
| - name: Clone Wiki | |
| run: make clone-wiki | |
| - name: Update Wiki | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_ACTOR: ${{ github.actor }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| run: | | |
| cd ../wiki | |
| rm -rf .git | |
| git init | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| remote="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.wiki.git" | |
| git remote add origin "$remote" | |
| git add . | |
| if [ -n "$(git status --porcelain)" ]; then | |
| timestamp=$(date -u +"%Y-%m-%d %H:%M:%S UTC") | |
| git commit -m "Update proxy lists - $timestamp" | |
| git branch -M master | |
| git push --force origin master | |
| fi |