ci(lint): skip prettier on push events — autofix handles main drift#75
Open
topcoder1 wants to merge 1 commit into
Open
ci(lint): skip prettier on push events — autofix handles main drift#75topcoder1 wants to merge 1 commit into
topcoder1 wants to merge 1 commit into
Conversation
Many fleet repos have pre-existing markdown formatting drift (~20-70 files per repo failing prettier). The reusable's prettier step ran on push:main events with no `prettier_changed_only` benefit (no PR context), so every post-merge lint run failed. Then prettier-autofix fired, pushed a fix commit, triggering another push:main, repeat. webcrawl saw 24 of 59 Lint runs fail in a 7d window from this loop. Gating prettier to pull_request events only: - Removes the loop (push:main never fails Lint on formatting) - Preserves PR-time prettier checking (which IS useful — it gates new bad files from landing) - Prettier-autofix workflow already handles main-branch drift via its own push:main trigger Actionlint and shellcheck remain on both event types — those are not in the autofix loop. Estimated savings: ~$2-3/mo across the fleet (~20 Lint callers). Plus reduces alarm fatigue from constant Lint failures on main. Auto-merge rationale: change to shared reusable workflow that ~20 callers reference. Touches .github/workflows/** which is high-risk per claude-author-automerge.yml policy — manual click-merge required. actionlint passes. Backwards-compatible (existing callers see prettier fire less often, never more). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Coverage Floor — mode:
|
|
Flagged 1 issue: the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prettierjob ran onpush:mainevents, scanning the full glob (no PR context forprettier_changed_only). Fleet repos with pre-existing markdown formatting drift (~20-70 files) fail every push:main lint run →prettier-autofix.ymlfires, pushes a fix commit → triggers anotherpush:main→ repeat. webcrawl had 24 Lint failures out of 59 runs in a recent 7-day window from this loop alone.github.event_name == 'pull_request'to theprettierjob'sif:condition (combined with the existingrun_prettiercheck). Prettier now only runs on PR events; push events skip it entirely.prettier_changed_onlyinput and all other inputs are unchanged. Actionlint and shellcheck remain on both event types.Why this is safe
push:maincan't gate anything — the merge already happened.prettier-autofix.ymlalready handles main-branch formatting drift onpush:main— prettier's job is now just catching new bad files before they land (PR-only).prettier_changed_onlybehavior on PRs is fully preserved.What changes
Before:
prettierjobif:=format('{0}', inputs.run_prettier) != 'false'(fires on both PR and push events)After:
prettierjobif:=github.event_name == 'pull_request' && format('{0}', inputs.run_prettier) != 'false'(fires on PR events only)The header comment block is also updated to document this behavior and the rationale.
Fleet impact
~20 fleet repos use the lint reusable via
topcoder1/ci-workflows. All benefit immediately after this merges — no caller changes needed. Estimated savings: ~$2-3/mo in CI minutes. More importantly, eliminates the Lint-failure alarm fatigue on main.Test plan
lint.ymlon pull_request trigger: prettier job runs and checks changed markdown files (unchanged behavior)lint.ymlon push:main trigger (after this PR merges): prettier job is skipped; actionlint still runsAuto-merge rationale: Touches
.github/workflows/**which is high-risk perclaude-author-automerge.ymlpolicy — manual click-merge required. Change is backwards-compatible (prettier fires less often, never more). Actionlint clean. No caller changes needed.🤖 Generated with Claude Code