mirror of
https://github.com/umbra2728/ctfd-mcp.git
synced 2026-02-07 22:08:12 +03:00
fix: CI workflow improvements and test config patch path fix
This commit is contained in:
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user