Skip to content

Commit 42a533a

Browse files
committed
✏️ Fix the broken tests caused by the file structure changes.
1 parent 9c4453c commit 42a533a

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

scripts/ci/release_intent.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff 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+
3248
def 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

4662
def 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

0 commit comments

Comments
 (0)