workflow: session handover gate 실행환경 모드 분리 (#353) #354
@@ -25,7 +25,7 @@ jobs:
|
|||||||
run: pip install ".[dev]"
|
run: pip install ".[dev]"
|
||||||
|
|
||||||
- name: Session handover gate
|
- name: Session handover gate
|
||||||
run: python3 scripts/session_handover_check.py --strict
|
run: python3 scripts/session_handover_check.py --strict --ci
|
||||||
|
|
||||||
- name: Validate governance assets
|
- name: Validate governance assets
|
||||||
env:
|
env:
|
||||||
|
|||||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
run: pip install ".[dev]"
|
run: pip install ".[dev]"
|
||||||
|
|
||||||
- name: Session handover gate
|
- name: Session handover gate
|
||||||
run: python3 scripts/session_handover_check.py --strict
|
run: python3 scripts/session_handover_check.py --strict --ci
|
||||||
|
|
||||||
- name: Validate governance assets
|
- name: Validate governance assets
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ def _check_handover_entry(
|
|||||||
*,
|
*,
|
||||||
branch: str,
|
branch: str,
|
||||||
strict: bool,
|
strict: bool,
|
||||||
|
ci_mode: bool,
|
||||||
errors: list[str],
|
errors: list[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
if not HANDOVER_LOG.exists():
|
if not HANDOVER_LOG.exists():
|
||||||
@@ -87,7 +88,7 @@ def _check_handover_entry(
|
|||||||
if token not in latest:
|
if token not in latest:
|
||||||
errors.append(f"latest handover entry missing token: {token}")
|
errors.append(f"latest handover entry missing token: {token}")
|
||||||
|
|
||||||
if strict:
|
if strict and not ci_mode:
|
||||||
today_utc = datetime.now(UTC).date().isoformat()
|
today_utc = datetime.now(UTC).date().isoformat()
|
||||||
if today_utc not in latest:
|
if today_utc not in latest:
|
||||||
errors.append(
|
errors.append(
|
||||||
@@ -117,6 +118,14 @@ def main() -> int:
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="Enforce today-date and current-branch match on latest handover entry.",
|
help="Enforce today-date and current-branch match on latest handover entry.",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--ci",
|
||||||
|
action="store_true",
|
||||||
|
help=(
|
||||||
|
"CI mode: keep structural/token checks but skip strict "
|
||||||
|
"today-date/current-branch matching."
|
||||||
|
),
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
errors: list[str] = []
|
errors: list[str] = []
|
||||||
@@ -128,7 +137,12 @@ def main() -> int:
|
|||||||
elif branch in {"main", "master"}:
|
elif branch in {"main", "master"}:
|
||||||
errors.append(f"working branch must not be {branch}")
|
errors.append(f"working branch must not be {branch}")
|
||||||
|
|
||||||
_check_handover_entry(branch=branch, strict=args.strict, errors=errors)
|
_check_handover_entry(
|
||||||
|
branch=branch,
|
||||||
|
strict=args.strict,
|
||||||
|
ci_mode=args.ci,
|
||||||
|
errors=errors,
|
||||||
|
)
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
print("[FAIL] session handover check failed")
|
print("[FAIL] session handover check failed")
|
||||||
|
|||||||
Reference in New Issue
Block a user