fix: CI workflow improvements and test config patch path fix

This commit is contained in:
2026-01-04 15:43:05 +03:00
parent ebfb6e0492
commit 2085fd4e37
2 changed files with 5 additions and 1 deletions

View File

@@ -3,8 +3,11 @@ name: Publish
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: [main]
tags: tags:
- "v*" - "v*"
pull_request:
branches: [main]
permissions: permissions:
contents: read contents: read
@@ -43,6 +46,7 @@ jobs:
publish: publish:
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
environment: environment:
name: pypi name: pypi
url: https://pypi.org/p/ctfd-mcp url: https://pypi.org/p/ctfd-mcp

View File

@@ -19,7 +19,7 @@ from ctfd_mcp.config import load_config
def _load_with_env(env: dict[str, str]): def _load_with_env(env: dict[str, str]):
"""Load config with isolated env and no .env side effects.""" """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): with patch.dict(os.environ, env, clear=True):
return load_config() return load_config()