File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,25 @@ class ReleaseIntentError(Exception):
2929 """Custom exception for release intent parsing errors."""
3030
3131
32+ def _resolve_tag_and_release_path () -> Path :
33+ """Return the directory containing tag and release artifacts."""
34+ candidates = [
35+ Path .cwd () / ".github" / "tag_and_release" ,
36+ Path .cwd ().parent / ".github" / "tag_and_release" ,
37+ Path (__file__ ).resolve ().parent .parent / ".github" / "tag_and_release" ,
38+ ]
39+
40+ for candidate in candidates :
41+ if candidate .exists ():
42+ return candidate
43+
44+ # Fall back to current working directory even if it doesn't exist yet to provide consistent error messaging
45+ return candidates [0 ]
46+
47+
3248def load_schema () -> SchemaType :
3349 """Load and return the JSON schema for release intent validation."""
34- schema_path = Path ( "../.github/tag_and_release/ schema.json")
50+ schema_path = _resolve_tag_and_release_path () / " schema.json"
3551
3652 if not schema_path .exists ():
3753 raise ReleaseIntentError (f"Schema file not found: { schema_path } " )
@@ -45,7 +61,7 @@ def load_schema() -> SchemaType:
4561
4662def load_intent_file () -> Optional [ReleaseIntent ]:
4763 """Load the release intent YAML file if it exists."""
48- intent_path = Path ( "../.github/tag_and_release/ intent.yaml")
64+ intent_path = _resolve_tag_and_release_path () / " intent.yaml"
4965
5066 if not intent_path .exists ():
5167 return None
You can’t perform that action at this time.
0 commit comments