From 24d2f97eae667a4245dc9bc5f1fc5a87e873a9fd Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 27 Jul 2026 07:31:55 +0200 Subject: [PATCH] fix(ci/winget): forward GITHUB_REF_NAME into the remote shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The catalogue-verify step has failed on every stable tag since it landed, v0.20.0 included: `bash: line 6: GITHUB_REF_NAME: unbound variable`, twice, then exit 1. `env:` populates the RUNNER's environment. appleboy/ssh-action executes its `script` on the REMOTE host over SSH, which inherits none of it — the action has a separate `envs:` input naming the variables to forward. Without it the `set -u` at the top of the script turns the first expansion into a fatal, and the two `curl`s either side report only the collateral: `Failed writing body` is curl losing its pipe when the `grep` it was feeding died. The failure is maximally misleading, because everything it guards ALREADY WORKED: the catalogue is built, tested and shipped in the preceding steps, and only the proof-of-serving fails. Confirmed by hand against the live source during the v0.20.0 release — it serves unom.PunktfunkHost 0.20.0 correctly. The pattern was already right everywhere else: both "Pull and start docs" steps (deploy-services.yml, docker.yml) pair `env:` with `envs:`. A sweep of the other three ssh-action steps found no further instance — the remaining two pass no variables at all. --- .gitea/workflows/windows-host.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitea/workflows/windows-host.yml b/.gitea/workflows/windows-host.yml index ff0fc47a..7e4be0b0 100644 --- a/.gitea/workflows/windows-host.yml +++ b/.gitea/workflows/windows-host.yml @@ -438,3 +438,9 @@ jobs: echo "winget source serving ${GITHUB_REF_NAME#v}" env: GITHUB_REF_NAME: ${{ gitea.ref_name }} + # `env:` populates the RUNNER's environment; this action runs `script` on the REMOTE + # host, which inherits nothing from it. `envs:` is the action's own allow-list of names + # to forward into the remote shell — without it `set -u` aborted at the first expansion + # ("GITHUB_REF_NAME: unbound variable") and the step failed on every tag, after the + # catalogue had already shipped correctly. + envs: GITHUB_REF_NAME