[build] simplify commit-changes workflow#17503
Conversation
Review Summary by QodoSimplify commit-changes workflow with unconditional push logic
WalkthroughsDescription• Simplify commit-changes workflow logic and error handling • Remove unnecessary conditional checks for artifact download • Always push changes when requested, regardless of conditions • Streamline git operations by removing redundant error exits Diagramflowchart LR
A["Download artifact"] --> B["Configure git user"]
B --> C["Check if patch exists"]
C --> D["Apply patch and commit"]
D --> E["Determine push target"]
E --> F["Push to branch or origin"]
F --> G["Output committed status"]
File Changes1. .github/workflows/commit-changes.yml
|
Code Review by Qodo
1. workflow_call outputs removed
|
There was a problem hiding this comment.
Pull request overview
This PR simplifies the reusable commit-changes GitHub Actions workflow by reducing conditional logic around applying a downloaded patch, committing it, and pushing updates (especially when push-branch is provided).
Changes:
- Simplifies the “apply patch + commit” flow to a single
-s changes.patchcheck and removes explicit error messaging. - Changes push behavior to always force-push when
push-branchis set (and only push the current branch when a commit was created). - Removes the explicit guard that exited early when the artifact download step didn’t succeed.
Comments suppressed due to low confidence (1)
.github/workflows/commit-changes.yml:66
PUSH_BRANCHtriggers an unconditionalgit push --forceeven when no patch was downloaded/applied and no commit was created. If the artifact download fails (it’scontinue-on-error) orchanges.patchis empty/missing, this can still force-update the target branch to the currently checked-out ref, potentially overwriting an existing remote branch/history. Consider only force-pushing when a commit was created, or use--force-with-leaseplus a safety check that the checked-out ref/branch matches the intended push target.
if [ -n "$PUSH_BRANCH" ]; then
git push --force origin HEAD:"$PUSH_BRANCH"
elif [ "$committed" = true ]; then
|
Persistent review updated to latest commit d08883b |
|
Persistent review updated to latest commit 8c353bf |
|
Persistent review updated to latest commit e2be623 |
e2be623 to
dba2640
Compare
|
Persistent review updated to latest commit dba2640 |
* origin/trunk: (97 commits) [py] update python dependencies (SeleniumHQ#17490) [build] fix renovate reported issues with configuration [build] remove base-ref from renovate workflows it does not work for the use case I had for them [build] add renovate dependency workflow (SeleniumHQ#17504) [build] simplify commit-changes workflow (SeleniumHQ#17503) [build] clarify dependency pin and update tasks (SeleniumHQ#17463) [build] do not rerun or attempt to upload logs unless workflow failure is from the Bazel step [build] fix renovate ignore rules_python to v2 until upstream fixed [build] renovate ignore rules_python until upstream fixed [build] bump rules_closure version (SeleniumHQ#17500) [build] bump rules_jvm_external (SeleniumHQ#17501) [js] remove npm dependency by using bazel for everything (SeleniumHQ#17499) [build] bump ruby versions to latest patch releases (SeleniumHQ#17496) [dotnet] [build] Support deterministic build output (SeleniumHQ#17497) [build] remove renovate update requests pending work done in SeleniumHQ#17427 (SeleniumHQ#17498) [dotnet] [build] Fix remote linkage in SourceLink (SeleniumHQ#17495) [rust] update reqwest to 0.13 (SeleniumHQ#17488) [build] bump low-risk Bazel module dependencies (SeleniumHQ#17494) [dotnet] run format against slnx instead of looping csproj (SeleniumHQ#17483) [build] ignore renovate.json references in renovate recommendations ... # Conflicts: # MODULE.bazel # rust/BUILD.bazel
Current code is doing a lot of work to manage a conditional that does not matter.
Just always push when requested.
This change is needed for a renovate fix I'm working on.
🤖 AI assistance
🔄 Types of changes