Skip to content

Self-hosted spotify downloader

TypeScript

ci(github-actions): add automatic ytdl update into github actions

raiper342ca165b59a76
diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml
deleted file mode 100644
index c9acbf9..0000000
--- a/.github/workflows/auto-merge.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: Auto-merge Github Actions
-on: pull_request
-
-permissions:
- pull-requests: write
- contents: write
-
-jobs:
- automerge:
- runs-on: ubuntu-latest
- if: github.event.pull_request.head.ref == 'ytdl-update-automated'
- steps:
- - uses: peter-evans/enable-pull-request-automerge@v3
- with:
- pull-request-number: ${{ github.event.pull_request.number }}
\ No newline at end of file
diff --git a/.github/workflows/update-ytdl.yml b/.github/workflows/update-ytdl.yml
index e77cdf7..fac8d85 100644
--- a/.github/workflows/update-ytdl.yml
+++ b/.github/workflows/update-ytdl.yml
@@ -18,13 +18,18 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: '18.x'
- - name: Update @distube/ytdl-core
- run: npm update @distube/ytdl-core -w backend
- - name: Commit and create PR
- uses: peter-evans/create-pull-request@v3
- with:
- title: 'build(ytdl): Upgrade ytdl package (automated)'
- branch: 'ytdl-update-automated'
- commit-message: 'build(ytdl): Upgrade ytdl package (automated)'
- token: ${{ secrets.AUTOUPDATE_PAT }}
+ - name: Update @distube/ytdl-core and release
+ run: |
+ npm update @distube/ytdl-core -w backend
+ if git diff --exit-code; then
+ echo "NO changes detected"
+ else
+ git config --global user.email "updater@spooty"
+ git config --global user.name "AutoUpdater"
+ git add .
+ git commit -m "fix(ytdl): Upgrade ytdl package (automated)"
+ npm run release -- --cli
+ fi
+ env:
+ GITHUB_TOKEN: ${{ secrets.AUTOUPDATE_PAT }}