Improve sync-back automation with automatic action detection, comment preservation, and tests

Co-authored-by: henrymercer <14129055+henrymercer@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-09-10 16:00:52 +00:00
parent 8d31b533a2
commit f77ed607fd
5 changed files with 383 additions and 56 deletions

View File

@@ -18,21 +18,32 @@ Manually run each step in the `justfile`.
When Dependabot updates action versions in the generated workflow files (`.github/workflows/__*.yml`),
the sync-back automation ensures those changes are properly reflected in the source templates.
The sync-back script automatically detects all actions used in generated workflows and preserves
version comments (e.g., `# v1.2.3`) when syncing versions between files.
### Running sync-back manually
To sync action versions from generated workflows back to source templates:
```bash
# Dry run to see what would be changed
./pr-checks/sync-back.sh --dry-run --verbose
python3 pr-checks/sync-back.py --dry-run --verbose
# Actually apply the changes
./pr-checks/sync-back.sh
python3 pr-checks/sync-back.py
```
The sync-back script (`sync-back.py`) automatically updates:
The sync-back script automatically updates:
- Hardcoded action versions in `pr-checks/sync.py`
- Action version references in template files in `pr-checks/checks/`
- Action version references in regular workflow files
This ensures that the `verify-pr-checks.sh` test always passes after Dependabot PRs.
### Testing
The sync-back script includes comprehensive tests that can be run with:
```bash
python3 pr-checks/test_sync_back.py -v
```