Add actionlint workflow and fix requirements traceability validator#279
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - name: Install validation dependencies | ||
| run: pip install pyyaml | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: |
There was a problem hiding this comment.
Install PyYAML after selecting runner Python
The workflow installs PyYAML before running actions/setup-python, so the package is placed in the runner’s default Python (currently 3.10) but the validation script later runs with the 3.11 interpreter configured by the setup step. On ubuntu-latest this causes the import yaml at runtime to fail with ModuleNotFoundError, preventing the traceability check from running on any branch. Move the pip install after the setup-python step (or use python -m pip from the configured interpreter) so the dependency is available to the Python version executing the script.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull Request Overview
This PR adds GitHub Actions workflow validation and improves requirements traceability validation by:
- Adding an
actionlintworkflow to validate GitHub Actions syntax automatically - Rewriting the requirements traceability validator to use PyYAML for robust YAML parsing
- Documenting workflow review findings and optimization recommendations
Key Changes
- New actionlint workflow enables syntax validation on workflow changes via push, pull requests, and manual dispatch
- Requirements validator now uses PyYAML instead of manual parsing, adds error handling for invalid front matter, and reports parsing failures
- Documentation added summarizing all workflows with highlighted findings about validation improvements
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/actionlint.yml | New workflow to validate GitHub Actions syntax using actionlint v1.7.1 |
| .github/workflows/requirements_validate_traceability.yml | Replaced manual YAML parsing with PyYAML, added invalid front matter tracking, improved error handling and code formatting |
| .github/workflows/REVIEW.md | New documentation summarizing all workflows with triggers, jobs, and key findings about validation improvements |
| - name: Install validation dependencies | ||
| run: pip install pyyaml | ||
|
|
||
| - name: Setup Python |
There was a problem hiding this comment.
Dependencies are installed before Python is set up. The 'Install validation dependencies' step should be moved after 'Setup Python' to ensure pip uses the correct Python version and environment. The current order may use the system Python instead of the configured 3.11 version.
| from typing import Iterable, List | ||
|
|
||
| import yaml | ||
|
|
||
| FRONT_MATTER_PATTERN = re.compile(r"^---\s*\n(.*?)\n---\s*", re.DOTALL) | ||
|
|
||
| def ensure_list(value: Iterable | str | None) -> List[str]: |
There was a problem hiding this comment.
The type hint Iterable | str | None is too broad. Since str is itself an Iterable, this may cause unexpected behavior if a string is processed as an iterable of characters rather than as a single string value. Consider using Iterable[Any] | str | None or reordering to str | Iterable | None with explicit type checks to ensure strings are handled correctly before other iterables.
| from typing import Iterable, List | |
| import yaml | |
| FRONT_MATTER_PATTERN = re.compile(r"^---\s*\n(.*?)\n---\s*", re.DOTALL) | |
| def ensure_list(value: Iterable | str | None) -> List[str]: | |
| from typing import Iterable, List, Any | |
| import yaml | |
| FRONT_MATTER_PATTERN = re.compile(r"^---\s*\n(.*?)\n---\s*", re.DOTALL) | |
| def ensure_list(value: str | Iterable[Any] | None) -> List[str]: |
Summary
Testing
Codex Task