CI/CD workflow and release-automation checks must be deterministic and behavior-based.
Example pattern (YAML parsing test):
from pathlib import Path
path = Path('.github/workflows/tag-release.yml')
text = path.read_text(encoding='utf-8')
import yaml # ensure pyyaml is in dev deps
yaml.safe_load(text) # must run in CI; no ImportError bypass
Example pattern (behavioral parity): extract the exact command/expression from the workflow and run it against the representative inputs (e.g., direct vs merge-commit message shapes) rather than asserting only that the snippet appears in the file.
Finally, in release scripts:
--dry-run is set.