Add .github/workflows/merge-fancode-playlist.yml
This commit is contained in:
parent
2dbc6eca03
commit
d26cd1b48c
1 changed files with 45 additions and 0 deletions
45
.github/workflows/merge-fancode-playlist.yml
vendored
Normal file
45
.github/workflows/merge-fancode-playlist.yml
vendored
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
name: Merge Fancode Playlist with My Playlist
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 */6 * * *' # Runs every 6 hours
|
||||||
|
workflow_dispatch: # Allows manual trigger too
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
merge:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Nadeko Repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Download Fancode Playlist
|
||||||
|
run: |
|
||||||
|
curl -L "https://raw.githubusercontent.com/drmlive/fancode-live-events/main/fancode.m3u" -o fancode_playlist.m3u
|
||||||
|
|
||||||
|
- name: Merge Playlists with Headers
|
||||||
|
run: |
|
||||||
|
echo "# --- Fancode Playlist: drmlive/fancode-live-events ---" > merged_playlist.m3u
|
||||||
|
cat fancode_playlist.m3u >> merged_playlist.m3u
|
||||||
|
echo "" >> merged_playlist.m3u
|
||||||
|
echo "# --- Your Playlist: MaskedWolff/maskedwolf ---" >> merged_playlist.m3u
|
||||||
|
cat my_playlist.m3u >> merged_playlist.m3u
|
||||||
|
|
||||||
|
- name: Commit and Push Merged Playlist
|
||||||
|
run: |
|
||||||
|
git config --global user.name "GitHub Actions"
|
||||||
|
git config --global user.email "github-actions@users.noreply.github.com"
|
||||||
|
|
||||||
|
# Pull the latest changes from the remote repository
|
||||||
|
git pull origin main --rebase || echo "No rebase needed"
|
||||||
|
|
||||||
|
# Add the merged playlist file
|
||||||
|
git add merged_playlist.m3u
|
||||||
|
|
||||||
|
# Commit the changes if there are updates
|
||||||
|
if git diff --cached --quiet; then
|
||||||
|
echo "No changes to commit"
|
||||||
|
else
|
||||||
|
git commit -m "Auto-merged Fancode playlist with My Playlist"
|
||||||
|
git push origin main
|
||||||
|
fi
|
Loading…
Add table
Reference in a new issue