From 2085fd4e37ac2865a238011a989f0c443df0316d Mon Sep 17 00:00:00 2001 From: umbra2728 Date: Sun, 4 Jan 2026 15:43:05 +0300 Subject: [PATCH] fix: CI workflow improvements and test config patch path fix --- .github/workflows/publish.yml | 4 ++++ tests/test_config.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ee2d9e4..0b9782f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,8 +3,11 @@ name: Publish on: workflow_dispatch: push: + branches: [main] tags: - "v*" + pull_request: + branches: [main] permissions: contents: read @@ -43,6 +46,7 @@ jobs: publish: needs: build runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') environment: name: pypi url: https://pypi.org/p/ctfd-mcp diff --git a/tests/test_config.py b/tests/test_config.py index a3965d9..adeecba 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -19,7 +19,7 @@ from ctfd_mcp.config import load_config def _load_with_env(env: dict[str, str]): """Load config with isolated env and no .env side effects.""" - with patch("config.load_dotenv", return_value=None): + with patch("ctfd_mcp.config.load_dotenv", return_value=None): with patch.dict(os.environ, env, clear=True): return load_config()