From b4ea4c2399d195acbd427d59e3828fec16692ecd Mon Sep 17 00:00:00 2001 From: Waozi Date: Sun, 22 Nov 2026 20:42:46 -0300 Subject: [PATCH] Accept Gitea's trailing-slash server URL in the deploy guard Gitea evaluates job conditions with its ROOT_URL, https://git.waozi.xyz/, so the exact comparison skipped the deploy job after every gate passed. The runtime check in the deploy job strips the same trailing slash. --- .gitea/workflows/ci.yml | 4 ++-- scripts/test_gitea_workflow.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5f80b41..8a7f089 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -254,7 +254,7 @@ jobs: deploy: needs: [checks, container] if: >- - github.server_url == 'https://git.waozi.xyz' && + (github.server_url == 'https://git.waozi.xyz' || github.server_url == 'https://git.waozi.xyz/') && github.repository == 'ziranlang/mesh' && github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && vars.MESH_DEPLOY_READY == 'true' && vars.MESH_DEPLOY_RUNNER != '' @@ -265,7 +265,7 @@ jobs: steps: - name: Verify canonical deployment context run: | - test "$GITHUB_SERVER_URL" = https://git.waozi.xyz + test "${GITHUB_SERVER_URL%/}" = https://git.waozi.xyz test "$GITHUB_REPOSITORY" = ziranlang/mesh test "$GITHUB_REF" = refs/heads/master case "$GITHUB_EVENT_NAME" in push|workflow_dispatch) ;; *) exit 1 ;; esac diff --git a/scripts/test_gitea_workflow.py b/scripts/test_gitea_workflow.py index 5421c54..fdb0c34 100644 --- a/scripts/test_gitea_workflow.py +++ b/scripts/test_gitea_workflow.py @@ -35,7 +35,8 @@ class GiteaWorkflowTest(unittest.TestCase): self.assertEqual(set(deploy["needs"]), REQUIRED_JOBS) self.assertEqual(set(self.jobs), REQUIRED_JOBS | {"deploy"}) for guard in ( - "github.server_url == 'https://git.waozi.xyz'", + # Gitea evaluates job conditions with its ROOT_URL, which ends in a slash. + "(github.server_url == 'https://git.waozi.xyz' || github.server_url == 'https://git.waozi.xyz/')", "github.repository == 'ziranlang/mesh'", "github.ref == 'refs/heads/master'", "(github.event_name == 'push' || github.event_name == 'workflow_dispatch')",