fix: make it work for joj3-forge-convert
All checks were successful
build / build (push) Successful in 1m43s
build / trigger-build-image (push) Successful in 9s

This commit is contained in:
张泊明518370910136 2025-06-14 05:28:41 -04:00
parent 2c1ad47f14
commit b14d83c37b
GPG Key ID: D47306D7062CDA9D

View File

@ -1,3 +1,4 @@
import os
from pathlib import Path
from typing import List
@ -62,5 +63,9 @@ class Config(BaseModel):
@model_validator(mode="after")
def set_grading_repo_name_from_cwd(self) -> "Config":
if not self.grading_repo_name:
self.grading_repo_name = Path.cwd().name
course_env = os.getenv("COURSE")
if course_env:
self.grading_repo_name = f"{course_env}-joj"
else:
self.grading_repo_name = Path.cwd().name
return self