File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 - " tests/**/*.py"
99 - " pyproject.toml"
1010 - " uv.lock"
11+ - " action.yml"
1112 - " .github/workflows/python-tests.yml"
1213 pull_request :
1314 paths :
1415 - " socket_basics/**/*.py"
1516 - " tests/**/*.py"
1617 - " pyproject.toml"
1718 - " uv.lock"
19+ - " action.yml"
1820 - " .github/workflows/python-tests.yml"
1921 workflow_dispatch :
2022
4951 V_TOML=$(python -c "import tomllib; print(tomllib.loads(open('pyproject.toml').read())['project']['version'])")
5052 [ "$V_PY" = "$V_TOML" ] || (echo "Version mismatch: version.py=$V_PY pyproject.toml=$V_TOML" && exit 1)
5153 echo "Version in sync: $V_PY"
54+
55+ - name : 🔒 Assert action.yml image ref matches version (once switched to pre-built)
56+ run : |
57+ python3 - <<'EOF'
58+ import re, sys, tomllib
59+ from pathlib import Path
60+
61+ action = Path("action.yml").read_text()
62+ version = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
63+
64+ match = re.search(r'image:\s*["\']docker://[^:]+:([^"\']+)["\']', action)
65+ if not match:
66+ print(f"SKIP: action.yml still uses Dockerfile — check will activate once switched to pre-built image")
67+ sys.exit(0)
68+
69+ action_version = match.group(1)
70+ if action_version != version:
71+ print(f"FAIL: action.yml refs {action_version} but version is {version}")
72+ print(f" Update action.yml image ref to docker://ghcr.io/socketdev/socket-basics:{version}")
73+ sys.exit(1)
74+
75+ print(f"OK: action.yml image ref matches version {version}")
76+ EOF
5277 - name : 🧪 Run tests
5378 run : pytest -q tests/
You can’t perform that action at this time.
0 commit comments