ci: auto-apply clang-tidy fixes on push/schedule via persistent autofix PR#2813
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the linux-eic-shell GitHub Actions workflow so that, on push and schedule, clang-tidy runs with in-place autofix enabled and the resulting changes are routed through a persistent “autofix” pull request branch that is updated on subsequent runs.
Changes:
- Run clang-tidy on all files with
-fix -formatforpush/scheduleevents. - Add a
peter-evans/create-pull-requeststep to create/update a stableclang-tidy-${{ github.ref_name }}PR targeting the source branch.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Capybara summary for PR 2813
Last updated 2026-08-02T12:18-04:00 535d768 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Head branch was pushed to by a user without write access
|
Works per #2820. Not saying that's what we should merge, but it gives the set of suggestions we think we should enforce in PRs, so we should adjust clang-tidy config if not correct. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/linux-eic-shell.yml:300
- PR description says the autofix/PR lifecycle is for
pushandschedule, but the workflow also enables it forworkflow_dispatch(both the all-files clang-tidy run and the PR creation condition). Either the PR description should be updated to include manual runs, orworkflow_dispatchshould be removed from these conditions to match the described behavior.
if: ${{ github.event_name == 'schedule' || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && startsWith(github.ref, 'refs/heads/')) }}
.github/workflows/linux-eic-shell.yml:277
pushruns in this workflow are triggered for tags too (on.push.tags: '*'). Withrun-clang-tidy -fix -format, this step will now modify the working tree on tag pushes, but the subsequent Create/Update clang-tidy PR step won’t run (it’s guarded bystartsWith(github.ref, 'refs/heads/')). That makes tag runs produce in-place modifications without any PR lifecycle, and can also affect later steps in the same job that assume a clean checkout.
Consider restricting the autofix run to branch refs (matching the PR-creation condition), or splitting “export fixes” (tags) vs “apply fixes + PR” (branches).
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
Briefly, what does this PR introduce? Please link to any relevant presentations or discussions.
On
pushandschedule, clang-tidy previously produced diagnostics/artifacts but did not apply fixes or maintain an autofix PR lifecycle. This change makes clang-tidy apply fixes and route them through a stable branch/PR that is updated on subsequent runs.-fix -formatto the all-files invocation.create-pull-requeststep forpush/schedule.clang-tidy-${{ github.ref_name }}.base: ${{ github.ref_name }}), so existing PRs are updated; missing ones are created.What is the urgency of this PR?
What kind of change does this PR introduce?
Please check if any of the following apply
AI was used to draft and apply the workflow update and prepare this PR summary.