Fix fork-skip guards for local test runs (#524 rebased, ssh:// origin form folded in) (#563)

* Fix fork-skip guards for local test runs

The fork skip read GITHUB_REPOSITORY with an upstream fallback, so local runs on a fork always ran the upstream-only guards. Share one helper that checks the origin remote when the variable is unset. Fixes #496.

* test: accept the ssh:// origin form in the upstream-checkout helper

An upstream clone whose origin is ssh://git@github.com/MadsLorentzen/ai-job-search(.git)
must keep running the placeholder guards; the helper only knew the https and
scp-style forms. Folded in at maintainer rebase per the #524 review.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Omarinho12345 <omarottelli720@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-15 11:59:57 +02:00
1 parent c922b0c757
commit 52f0b2719b
5 files changed
+189 -7

No files matched your search

+6 -4
View File
@@ -15,11 +15,13 @@ the sentinels exist in the pristine files, and (c) that simulating the
/setup edit destroys at least one checked sentinel per file - i.e. the
guard actually fires on the failure it exists to catch.
"""
import os
import unittest
from pathlib import Path
UPSTREAM = "MadsLorentzen/ai-job-search"
try:
from tests._upstream import is_upstream_checkout
except ImportError: # `python -m unittest discover -s tests` imports test modules top-level
from _upstream import is_upstream_checkout
REPO = Path(__file__).resolve().parent.parent
CI = REPO / ".github" / "workflows" / "ci.yml"
@@ -45,7 +47,7 @@ def personalize_cv(text: str) -> str:
@unittest.skipIf(
os.environ.get("GITHUB_REPOSITORY", UPSTREAM) != UPSTREAM,
not is_upstream_checkout(),
"placeholder-integrity guards the pristine upstream template; forks personalize these files via /setup",
)
class TestCvSentinelsAreDataLocated(unittest.TestCase):
@@ -82,7 +84,7 @@ class TestCvSentinelsAreDataLocated(unittest.TestCase):
@unittest.skipIf(
os.environ.get("GITHUB_REPOSITORY", UPSTREAM) != UPSTREAM,
not is_upstream_checkout(),
"placeholder-integrity guards the pristine upstream template; forks personalize these files via /setup",
)
class TestProfileSentinelIsDataLocated(unittest.TestCase):