From cc8f7546f89eb803ce59eccefab950c5b220cd9e Mon Sep 17 00:00:00 2001 From: freearhey Date: Thu, 6 May 2021 16:24:54 +0300 Subject: [PATCH] Update auto-update.yml --- .github/workflows/auto-update.yml | 32 ++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 0db12eaf28..26083fe5e3 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -4,8 +4,26 @@ on: schedule: - cron: '0 0 * * *' jobs: + remove-duplicates: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Dependencies + run: npm install + - name: Remove Duplicates + run: node scripts/remove-duplicates.js + - 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] Remove duplicates" + git pull + git push format: runs-on: ubuntu-latest + needs: remove-duplicates continue-on-error: true strategy: matrix: @@ -176,13 +194,13 @@ jobs: run: npm install - name: Format Playlists run: node scripts/format.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] Format playlists" - # git push + - 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] Format ${{ matrix.country }}.m3u" + git push generate: runs-on: ubuntu-latest needs: format