From 235bad253ac31ea91af0ffd0e76d84a08ebe882a Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Thu, 9 Jul 2026 10:13:02 -0600 Subject: [PATCH] ci(snap): skip the Snap Store publish when no store credentials are set The publish step failed the whole run with "login_data is empty" when SNAPCRAFT_STORE_CREDENTIALS is unset, even though both binaries compiled and the amd64 snap packed fine. Move the secret to job level and gate the publish step on it: with no secret the snap is still built and uploaded as an artifact, publish is skipped (green run) instead of failing. Applies to both arches. cc --- .github/workflows/release-snap.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-snap.yml b/.github/workflows/release-snap.yml index d13b5cf8e..bc829f364 100644 --- a/.github/workflows/release-snap.yml +++ b/.github/workflows/release-snap.yml @@ -183,6 +183,11 @@ jobs: # but snapcraft's container bootstrap alone is highly variable on public # runners — give it real headroom. timeout-minutes: 90 + # Credentials at job level so the publish step can gate on them: an empty / + # unset secret SKIPS publish instead of failing the whole run (the snap is + # still built and uploaded as an artifact). + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} steps: - uses: actions/checkout@v4 @@ -225,10 +230,9 @@ jobs: path: ${{ steps.build.outputs.snap }} if-no-files-found: error - - name: Publish to the Snap Store + - name: Publish to the Snap Store (skipped when no store credentials) + if: ${{ env.SNAPCRAFT_STORE_CREDENTIALS != '' }} uses: snapcore/action-publish@v1 - env: - SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} with: snap: ${{ steps.build.outputs.snap }} release: ${{ github.event.inputs.channel || 'edge' }} @@ -239,6 +243,8 @@ jobs: # No compilation here (plugin: dump); the headroom is for snapcraft's LXD # bootstrap, which is variable on hosted runners. timeout-minutes: 90 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} steps: - uses: actions/checkout@v4 @@ -278,10 +284,9 @@ jobs: path: ${{ steps.build.outputs.snap }} if-no-files-found: error - - name: Publish to the Snap Store + - name: Publish to the Snap Store (skipped when no store credentials) + if: ${{ env.SNAPCRAFT_STORE_CREDENTIALS != '' }} uses: snapcore/action-publish@v1 - env: - SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} with: snap: ${{ steps.build.outputs.snap }} release: ${{ github.event.inputs.channel || 'edge' }}