]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
build: run the Vue UI pcloud steps only when PCLOUD_TOKEN is available
authorPim Zandbergen <pim@zandbergen.org>
Wed, 8 Jul 2026 22:12:55 +0000 (00:12 +0200)
committerFlole <Flole998@users.noreply.github.com>
Thu, 9 Jul 2026 07:23:03 +0000 (09:23 +0200)
The 'Check pcloud' and 'Upload to pcloud' steps were gated only on
github.ref == 'refs/heads/master', which is also true on forks, where
the PCLOUD_TOKEN secret is absent and pcloud.py exits with an error,
failing the whole job.

Additionally, the check step never received the token at all, so
listfolder always failed silently (stderr discarded) and reported
'Missing from pcloud', causing a redundant re-upload on every
upstream master build.

Gate both steps on the secret being present and inject the token
into the check step as well.

.github/workflows/webui-vue-build.yml

index e43f0e364b83a5198daa7c668aa73599041aeb9e..e4012ae5374f69d4ca483996ef26fd5835c6b7dd 100644 (file)
@@ -39,7 +39,12 @@ jobs:
     outputs:
       source_hash:   ${{ steps.hash.outputs.hash }}
       artifact_name: webui-vue-${{ steps.hash.outputs.hash }}
-    # PCLOUD_TOKEN is injected at the step level for uploads only.
+    # PCLOUD_TOKEN is mapped into env at the job level so the pcloud
+    # steps can test its presence in their `if` (the secrets context
+    # itself is not allowed in step-level `if`). It is empty on forks
+    # and in token-less callers (build-ci); the pcloud steps then skip.
+    env:
+      PCLOUD_TOKEN: ${{ secrets.PCLOUD_TOKEN }}
     steps:
       - name: Checkout
         # v5 (not v6) — actions/checkout v6 ships a new credential model
@@ -80,10 +85,12 @@ jobs:
         if: steps.cache.outputs.cache-hit != 'true'
         run: make -f Makefile.webui-vue pack ROOTDIR="$PWD" BUILDDIR="$PWD/build.linux"
 
-      # ---- pCloud Upload (only on master) ----
+      # ---- pCloud Upload (only on master, and only when the repo has
+      # the PCLOUD_TOKEN secret — forks don't, and pcloud.py needs it
+      # even for listfolder) ----
       - name: Check pcloud
         id: check_pcloud
-        if: github.ref == 'refs/heads/master'
+        if: github.ref == 'refs/heads/master' && env.PCLOUD_TOKEN != ''
         run: |
           set +e
           python3 support/pcloud.py listfolder /misc/webui 2>/dev/null \
@@ -99,9 +106,7 @@ jobs:
           fi
 
       - name: Upload to pcloud
-        if: github.ref == 'refs/heads/master' && steps.check_pcloud.outputs.pcloud_hit != 'true'
-        env:
-          PCLOUD_TOKEN: ${{ secrets.PCLOUD_TOKEN }}
+        if: github.ref == 'refs/heads/master' && env.PCLOUD_TOKEN != '' && steps.check_pcloud.outputs.pcloud_hit != 'true'
         run: |
           python3 support/pcloud.py upload \
             "/misc/webui/webui-vue-${{ steps.hash.outputs.hash }}.tgz" \