From a8dfd7017b06330e92e80dd95fceaf823970cd62 Mon Sep 17 00:00:00 2001 From: Ultradesu Date: Fri, 2 Oct 2026 12:50:04 +0100 Subject: [PATCH] Gate the GitHub release workflow on a repo variable, not server_url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The github.server_url guard did not keep this workflow from running on Gitea: Gitea reports github.server_url as https://github.com, so the condition was true there too and the jobs ran (and would fail on @v4/gh). Switch both job guards to `vars.GITHUB_RELEASE == 'true'`, a repository variable set only in the GitHub repo's settings. It is deterministic: absent on Gitea, so the jobs skip there and the .gitea workflow is the one that runs; present on GitHub once configured, so it runs there. The header documents how to set it (Settings → Secrets and variables → Actions → Variables → GITHUB_RELEASE=true). Co-Authored-By: Claude Opus 4.8 --- .github/workflows/release.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 479d52d..0885be4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,9 +6,14 @@ name: Release # artifact backend and fills the release with `gh`. # # Gitea reads both .gitea/workflows and .github/workflows, so without a guard it -# would also try to run this file and fail on @v4 and `gh`. Every job is gated -# on running on github.com, so on Gitea they are simply skipped — the Gitea file -# is the one that runs there. +# would also try to run this file and fail on @v4 and `gh`. (Gitea reports +# github.server_url as https://github.com, so that cannot tell the two apart.) +# Instead every job is gated on a repository variable GITHUB_RELEASE=true, which +# is set only in the GitHub repository's settings — so on Gitea, where it is +# absent, these jobs are skipped and the .gitea file is the one that runs. +# +# To enable on GitHub: Settings → Secrets and variables → Actions → Variables → +# New variable, name GITHUB_RELEASE, value true. on: push: tags: ["v*"] @@ -23,7 +28,7 @@ env: jobs: build: name: ${{ matrix.asset }} - if: ${{ github.server_url == 'https://github.com' }} + if: ${{ vars.GITHUB_RELEASE == 'true' }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -144,7 +149,7 @@ jobs: publish: name: Publish release needs: build - if: ${{ github.server_url == 'https://github.com' }} + if: ${{ vars.GITHUB_RELEASE == 'true' }} runs-on: ubuntu-latest permissions: contents: write