fix: harden action publication workflow#15
Conversation
Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by mimo-v2-pro-20260318 · 85,703 tokens |
There was a problem hiding this comment.
Code Review
This pull request enhances the test suite for action repository workflow synchronization by adding assertions for repository creation logic and source reference metadata. The review feedback recommends using regular expressions for more robust string matching and removing a redundant assertion to improve test maintainability.
| assert "hashgraph-online/hol-codex-plugin-scanner-action" in workflow_text | ||
| assert "Validate publication credentials" in workflow_text | ||
| assert 'if: secrets.ACTION_REPO_TOKEN != \'\'' not in workflow_text | ||
| assert "inputs.create_repository && 'true' || 'false'" in workflow_text |
There was a problem hiding this comment.
This assertion, which checks for an exact string, is a bit brittle. It could fail if there are minor, semantically-irrelevant formatting changes in the workflow file (e.g., extra spaces). Consider using a regular expression to make the check more robust against such changes. For example:
import re
# ...
assert re.search(r"inputs\.create_repository\s*&&\s*'true'\s*\|\|\s*'false'", workflow_text)| assert "Validate publication credentials" in workflow_text | ||
| assert 'if: secrets.ACTION_REPO_TOKEN != \'\'' not in workflow_text | ||
| assert "inputs.create_repository && 'true' || 'false'" in workflow_text | ||
| assert "SOURCE_REF" in workflow_text |
Summary
create_repository=falsework correctly on workflow dispatchVerification
.venv/bin/python -m pytest tests/test_action_bundle.py -q.venv/bin/python -m pytest -qyq . .github/workflows/publish-action-repo.yml >/dev/null