-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[build] add reusable commit-changes.yml workflow #16965
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
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||
PR Code Suggestions ✨Latest suggestions up to 4e296c3
Previous suggestions✅ Suggestions up to commit 5e09c2c
✅ Suggestions up to commit 8d46d3a
✅ Suggestions up to commit 83eac7c
✅ Suggestions up to commit af68a41
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 introduces a reusable workflow commit-changes.yml to eliminate code duplication across multiple CI workflows that follow a common pattern: generate changes, download a patch artifact, apply the patch, commit, and push.
Changes:
- Added new reusable workflow
.github/workflows/commit-changes.ymlwith configurable inputs for artifact name, commit message, git ref, and push branch - Refactored 5 existing workflows to use the new reusable workflow:
release.yml,pre-release.yml,pin-browsers.yml,ci-renovate-rbe.yml, andci-lint.yml - Simplified
pin-browsers.ymlto useghCLI for PR creation instead ofpeter-evans/create-pull-requestaction
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/commit-changes.yml |
New reusable workflow that handles downloading patch artifacts, applying changes, committing, and pushing to a branch with configurable parameters |
.github/workflows/release.yml |
Refactored update-version job to use the new reusable workflow |
.github/workflows/pre-release.yml |
Refactored push-rust-version job to use the new reusable workflow; updated comment on line 33 |
.github/workflows/pin-browsers.yml |
Split logic into push-changes (using reusable workflow) and create-pr jobs; switched from peter-evans/create-pull-request to gh CLI |
.github/workflows/ci-renovate-rbe.yml |
Refactored commit-repins job to use the new reusable workflow |
.github/workflows/ci-lint.yml |
Refactored commit-fixes job to use the new reusable workflow; moved fork check to job-level condition |
af68a41 to
8fb00be
Compare
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
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
e6c02f7 to
51a500e
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
51a500e to
8d46d3a
Compare
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
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
- Fix typo in pre-release.yml comment ("Run rust jobs run" -> "Run rust jobs")
- Improve error handling in commit-changes.yml: replace set -e with explicit
error checking to ensure committed output is always set before exit
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use heredoc to avoid YAML indentation issues in multi-line string. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8d46d3a to
5e09c2c
Compare
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
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
- Add actions: read permission for reliable artifact access - Check download outcome to distinguish between "artifact not found" and "patch was empty" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
* [build] add reusable commit-changes.yml workflow * Update .github/workflows/pre-release.yml
User description
Repeated pattern with our bazel.yml approach. Bazel workflow generates a patch, then calling workflow does:
💥 What does this PR do?
Adds a reusable
commit-changes.ymlworkflow to manage this flowRefactors the following workflows to use it:
🔧 Implementation Notes
This pattern was duplicated across 5 workflows with minor variations. The reusable workflow supports:
💡 Additional Considerations
More tweaks to simplify incoming
🔄 Types of changes
PR Type
Enhancement
Description
Introduces reusable
commit-changes.ymlworkflow for standardized patch applicationRefactors 5 workflows to use centralized commit-changes workflow
Supports custom artifact names, commit messages, and optional branch pushing
Eliminates duplicated patch-apply-commit-push logic across workflows
Diagram Walkthrough
File Walkthrough
commit-changes.yml
New reusable workflow for patch management.github/workflows/commit-changes.yml
configuration, and commit/push operations
optional push-branch
push-branchparameterchanges-committedflag to indicate success/failureSELENIUM_CI_TOKENsecret for authenticatedoperations
pin-browsers.yml
Refactor to use commit-changes and gh CLI.github/workflows/pin-browsers.yml
pull-requestjob into two separate jobs:push-changesandcreate-prpush-changesjob now usescommit-changes.ymlwith force-push topinned-browser-updatesbranchcreate-prjob uses GitHub CLI to create PR, checking for existing PRsto avoid duplicates
peter-evans/create-pull-requestaction with nativegh prcreatecommandci-lint.yml
Refactor to use commit-changes workflow.github/workflows/ci-lint.yml
commit-changes.ymlcommit-fixesjob to use reusable workflow withartifact-name and commit-message inputs
ci-renovate-rbe.yml
Refactor to use commit-changes workflow.github/workflows/ci-renovate-rbe.yml
commit-changes.ymlcallcommit-repinsjob configurationpre-release.yml
Refactor to use commit-changes workflow.github/workflows/pre-release.yml
push-rust-versionjob withcommit-changes.ymlcallrust-release-${{ inputs.version }}branch viapush-branchparameterSELENIUM_CI_TOKENsecret to reusable workflowrelease.yml
Refactor to use commit-changes workflow.github/workflows/release.yml
update-versionjob withcommit-changes.ymlcallSELENIUM_CI_TOKENsecret for authenticated git operations