Update .forgejo/workflows/generate-m3u.yml
All checks were successful
Generate M3U Playlist with Auto-Organization / build-and-organize (push) Successful in 1m29s

This commit is contained in:
stoney420 2025-06-28 07:54:47 +02:00
parent 884b6e1816
commit 1417e316ea

View file

@ -25,8 +25,6 @@ jobs:
- name: Basic Setup
run: |
# This step previously contained explicit cleanup and Python setup.
# These are now handled by the environment or within generate_playlist.py if needed.
echo "Basic setup complete."
- name: Run Playlist Generation
@ -39,19 +37,27 @@ jobs:
git add .
if ! git diff-index --quiet HEAD; then
echo "Changes detected, committing..."
# Fetch latest changes from remote and rebase local changes on top
# --- NEW STEPS ---
# 1. Commit the changes made by this workflow locally first.
# This puts the local repository in a clean state for git pull --rebase.
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
git commit -m "📺 Workflow generated files: $CHANNELS channels (temp commit for rebase)"
# 2. Pull the latest changes from remote and rebase our local commit on top.
git pull --rebase origin main
# Get channel count for commit message
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
git commit -m "📺 Updated playlist with $CHANNELS channels - $(date '+%Y-%m-%d %H:%M')"
# --- END NEW STEPS ---
# Now, push the rebased commit.
git push
echo "Changes committed"
echo "Changes committed successfully"
else
echo "No changes to commit"
fi
- name: Summary
run: |
# Get channel count for summary
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
echo "=== WORKFLOW COMPLETE ==="
echo "✅ Playlist has $CHANNELS channels"