Small optimization to release action
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 23 Oct 2025 07:54:20 +0000 (09:54 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 23 Oct 2025 07:54:20 +0000 (09:54 +0200)
.github/workflows/release.yml

index 5649bb29c90ef638e0f04c2fb4356032dd30900c..4986d16a594fb1d271aea6d465aa96d99f232409 100644 (file)
@@ -219,12 +219,19 @@ jobs:
               PREV_TAG=$(git tag --sort=-version:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.b[0-9]+$' | head -n 1)
               ;;
             nightly)
+              # Try to find previous nightly
               PREV_TAG=$(git tag --sort=-version:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+$' | head -n 1)
+
+              # If no nightly found, fall back to last prerelease (beta)
+              if [ -z "$PREV_TAG" ]; then
+                echo "⚠️  No previous nightly found, falling back to last prerelease"
+                PREV_TAG=$(git tag --sort=-version:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.(b|dev)[0-9]+$' | head -n 1)
+              fi
               ;;
           esac
 
           if [ -z "$PREV_TAG" ]; then
-            echo "⚠️  No previous $CHANNEL release found"
+            echo "⚠️  No previous $CHANNEL release found (and no fallback available)"
             echo "prev_tag=" >> $GITHUB_OUTPUT
             echo "has_prev_tag=false" >> $GITHUB_OUTPUT
           else
@@ -546,7 +553,7 @@ jobs:
         uses: actions/checkout@v5
         with:
           repository: music-assistant/home-assistant-addon
-          token: ${{ secrets.GITHUB_TOKEN }}
+          token: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }}
           path: addon-repo
 
       - name: Get release notes