diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index 9cad4641b5..e71508e7c3 100644 --- a/.github/workflows/clean.yml +++ b/.github/workflows/clean.yml @@ -4,7 +4,7 @@ on: schedule: - cron: '0 6 * * 0' jobs: - clean: + update: runs-on: ubuntu-latest continue-on-error: true strategy: @@ -172,10 +172,28 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: bot/patch-${{ github.run_number }} - name: Install Dependencies run: npm install - name: Remove Broken Links run: node scripts/clean.js --country=${{ matrix.country }} + - name: Commit Changes + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git diff-index --quiet HEAD || git commit -m "[Bot] Update ${{ matrix.country }}.m3u" + git pull + git push + create-pr: + runs-on: ubuntu-latest + needs: update + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: bot/patch-${{ github.run_number }} - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: