-
Notifications
You must be signed in to change notification settings - Fork 408
Sync Action version updates back to the source templates in the pr-checks
directory
#3094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync Action version updates back to the source templates in the pr-checks
directory
#3094
Conversation
@copilot It looks like you don't have access to push changes to |
2 similar comments
@copilot It looks like you don't have access to push changes to |
@copilot It looks like you don't have access to push changes to |
Co-authored-by: henrymercer <[email protected]>
I've recreated the sync-back automation without modifying the rebuild workflow as requested. The changes include:
The automation successfully synced the following action version updates:
All changes are now committed in 8d31b53. |
|
… preservation, and tests Co-authored-by: henrymercer <[email protected]>
I've addressed all the feedback points in commit f77ed60:
The automation now auto-detects 7 different actions in the current workflows and handles comment preservation correctly. |
@copilot That looks great, thanks! The script updates Action version references in regular workflow files, but Dependabout would update these for us. It's only the ones in |
Co-authored-by: henrymercer <[email protected]>
Updated the script to only update the necessary files (sync.py and pr-checks templates). Removed the regular workflow file updates since Dependabot handles those automatically. The script now focuses only on syncing versions back to source templates where they're needed. Commit 5d79536. |
@copilot Great. Before, you didn't seem to have access to modify |
Co-authored-by: henrymercer <[email protected]>
I've successfully modified the rebuild workflow to run the sync-back script before sync.py. The workflow now executes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the CodeQL Action repository with comprehensive sync-back automation for Dependabot action version updates. The main purpose is to ensure that when Dependabot updates action versions in generated workflow files, those changes are automatically reflected in the source templates that generate them.
Key changes include:
- New sync-back automation system: A Python script that automatically detects action versions from generated workflows and syncs them back to source templates
- Workflow integration: Integration of the sync-back script into the rebuild workflow to prevent conflicts
- Updated action versions: Bump of actions/setup-go, actions/github-script, actions/setup-node, and actions/setup-python to their latest versions
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
pr-checks/sync_back.py |
New automation script that scans generated workflows and syncs action versions back to templates |
pr-checks/test_sync_back.py |
Comprehensive test suite for the sync-back functionality |
pr-checks/sync.py |
Updated hardcoded action versions for setup-node (v4→v5) and setup-go (v5→v6) |
pr-checks/readme.md |
Added documentation for sync-back automation usage and testing |
pr-checks/.gitignore |
Added Python cache file exclusions |
.github/workflows/rebuild.yml |
Integrated sync-back script execution before sync.py |
.github/workflows/pr-checks.yml |
Added test execution for pr-checks module |
Template files in pr-checks/checks/ |
Updated action versions (github-script v7→v8, setup-go v5→v6) to match current versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a script to sync-back the version updates that Dependabot makes to the generated workflow files would be a nice QoL improvement for us.
I am not a huge fan of this particular work, although I won't object to merging it once we have decided what to do about my comments. I've added a bunch of comments about things in this that are subtly wrong or could easily break. Those can be fixed or ignored.
In the long run, I'd like to see us invest less in adding more Python scripts and associated infrastructure to the repo and implement new scripts in less ad-hoc and more maintainability way.
In favour of docs in the script itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you've addressed my main concerns here; just a few small follow-up comments.
c656a25
into
dependabot/github_actions/actions-f739f361ea
Bumps the actions group with 4 updates: actions/setup-go, actions/github-script, actions/setup-node and actions/setup-python.
Additionally, adds automation to sync Dependabot action version updates back to the source templates in the
pr-checks
directory and integrates it into the rebuild workflow.Dependabot Updates
Updates
actions/setup-go
from 5 to 6Updates
actions/github-script
from 7 to 8Updates
actions/setup-node
from 4 to 5Updates
actions/setup-python
from 5 to 6Enhanced Sync-Back Automation
This PR adds a new Python script (
pr-checks/sync-back.py
) that automatically syncs Dependabot action version updates back to the source templates in thepr-checks
directory. When Dependabot updates action versions in the generated workflows (.github/workflows/__*.yml
), this script ensures those changes are properly reflected in:pr-checks/sync.py
pr-checks/checks/
The script does not update regular workflow files since Dependabot handles those automatically, focusing only on the source templates that require sync-back.
Key Features
uses:
entries in generated workflows to automatically identify which actions need syncing (no hardcoded list required)uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0
when syncing versionspython3 pr-checks/sync-back.py
without shell wrappertest_sync_back.py
) covering all functionalitysync.py
The script automatically detects and handles multiple action types beyond the original 4, ensuring the
verify-pr-checks.sh
test always passes.Workflow Integration
The sync-back script is now integrated into the rebuild workflow (
.github/workflows/rebuild.yml
) to run automatically before thesync.py
script. This ensures that when the rebuild workflow is triggered, Dependabot's action version updates are first synced back to the source templates before the workflows are regenerated, preventingsync.py
from overwriting Dependabot's changes.Files Added/Modified
pr-checks/sync-back.py
- Enhanced sync-back script with auto-detection and comment preservationpr-checks/test_sync_back.py
- Comprehensive test suitepr-checks/readme.md
- Updated documentation with new usage examples and testing instructionspr-checks/.gitignore
- Added Python cache exclusions.github/workflows/rebuild.yml
- Integrated sync-back script execution before sync.py✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.