Skip to content

Commit 7ec57fe

Browse files
ci: fix PR126 promotion helper source-id audit
1 parent b396967 commit 7ec57fe

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/pr126-promote-ec511f53-evidence.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ jobs:
3030
run: python -m pip install pytest 'jsonschema[format]'
3131
- name: Audit and promote physical evidence
3232
run: |
33+
python - <<'PY'
34+
from pathlib import Path
35+
path = Path('.github/scripts/pr126_promote_ec511.py')
36+
text = path.read_text(encoding='utf-8')
37+
old = '''replace_once(catalog_test, OLD_VID, VID)
38+
replace_once(catalog_test, OLD_PID, PID)
39+
'''
40+
new = '''text = catalog_test.read_text(encoding="utf-8")
41+
if text.count(OLD_VID) != 2 or text.count(OLD_PID) != 2:
42+
raise RuntimeError("Stage-C canonical source-id occurrence count drifted")
43+
text = text.replace(OLD_VID, VID).replace(OLD_PID, PID)
44+
catalog_test.write_text(text, encoding="utf-8")
45+
'''
46+
if text.count(old) != 1:
47+
raise SystemExit('promotion helper source-id patch marker drifted')
48+
path.write_text(text.replace(old, new, 1), encoding='utf-8')
49+
PY
3350
python -m py_compile .github/scripts/pr126_promote_ec511.py
3451
python .github/scripts/pr126_promote_ec511.py
3552
git diff --check

0 commit comments

Comments
 (0)