From 1417e316eacc4cd3f3394c93c465e88e21633cd0 Mon Sep 17 00:00:00 2001 From: stoney420 Date: Sat, 28 Jun 2025 07:54:47 +0200 Subject: [PATCH] Update .forgejo/workflows/generate-m3u.yml --- .forgejo/workflows/generate-m3u.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/generate-m3u.yml b/.forgejo/workflows/generate-m3u.yml index e5f8bc7..c67d02d 100644 --- a/.forgejo/workflows/generate-m3u.yml +++ b/.forgejo/workflows/generate-m3u.yml @@ -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" \ No newline at end of file