diff --git a/.github/workflows/profile-checks.yml b/.github/workflows/profile-checks.yml new file mode 100644 index 0000000..60f6cca --- /dev/null +++ b/.github/workflows/profile-checks.yml @@ -0,0 +1,30 @@ +name: Profile checks + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + parity: + runs-on: ${{ matrix.os }} + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: python -m pip install pytest + - name: Check profile parity and privacy boundaries + env: + DOC_BRICKS_PRIVATE_REPOS: ${{ secrets.DOC_BRICKS_PRIVATE_REPOS }} + run: python -m pytest -q diff --git a/tests/test_private_guard.py b/tests/test_private_guard.py new file mode 100644 index 0000000..606ef1b --- /dev/null +++ b/tests/test_private_guard.py @@ -0,0 +1,13 @@ +"""Check that a privacy failure does not echo the configured private name.""" +import pytest + +import test_profile_parity as profile + + +def test_private_name_is_absent_from_failure(monkeypatch): + name = "synthetic-private-sentinel-62941" + monkeypatch.setenv(profile.PRIVATE_REPOS_ENV, name) + monkeypatch.setattr(profile, "get_file_content", lambda _path: name) + with pytest.raises(AssertionError) as caught: + profile.test_private_repo_leak_guard() + assert name not in str(caught.value) diff --git a/tests/test_profile_parity.py b/tests/test_profile_parity.py index 617383b..61de874 100644 --- a/tests/test_profile_parity.py +++ b/tests/test_profile_parity.py @@ -96,7 +96,8 @@ def test_private_repo_leak_guard(): for rel_path in target_files: content = get_file_content(rel_path) for private_repo in private_repos: - assert private_repo not in content, "Private repository name found in public docs" + if private_repo in content: + raise AssertionError("Private repository name found in public docs") def test_check_timestamp_parity(): """Verify verification date 2026-10-13 across profile files."""