ci: add --ci mode for session handover gate in workflows (#353)
Some checks failed
Gitea CI / test (push) Failing after 5s
Gitea CI / test (pull_request) Failing after 6s

This commit is contained in:
agentson
2026-03-01 20:02:48 +09:00
parent e65a0e3585
commit 6f047a6daf
3 changed files with 18 additions and 4 deletions

View File

@@ -66,6 +66,7 @@ def _check_handover_entry(
*,
branch: str,
strict: bool,
ci_mode: bool,
errors: list[str],
) -> None:
if not HANDOVER_LOG.exists():
@@ -87,7 +88,7 @@ def _check_handover_entry(
if token not in latest:
errors.append(f"latest handover entry missing token: {token}")
if strict:
if strict and not ci_mode:
today_utc = datetime.now(UTC).date().isoformat()
if today_utc not in latest:
errors.append(
@@ -117,6 +118,14 @@ def main() -> int:
action="store_true",
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()
errors: list[str] = []
@@ -128,7 +137,12 @@ def main() -> int:
elif branch in {"main", "master"}:
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:
print("[FAIL] session handover check failed")