Repository navigation
ci: Lint Markdown survives force-pushes - #139
Merged
Merged
Conversation
A force-push leaves github.event.before pointing at a commit the runner cannot resolve, so git diff failed with "bad object". Fall back to the pushed commit's own files whenever the before commit is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The fallback misses Markdown changed in earlier commits of a multi-commit force-push.
Review effort: Balanced
Findings: 1
What changed in this PR
Updates Markdown linting to handle unresolved pre-push commits.
Changes:
- Detects missing
beforecommits withgit cat-file. - Falls back to linting files from the pushed tip commit.
| File | Description |
|---|---|
.github/workflows/lint-markdown.yml |
Adds force-push fallback handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mpaulosky
enabled auto-merge (squash)
September 29, 2026 01:28
Contributor
A force-push that rewrites several commits would only have linted the tip commit. Diff against the merge base with main instead, so every Markdown change on the branch is checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On main, origin/main is the pushed commit itself, so the merge-base diff is empty. With no usable base there, lint every tracked Markdown file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #139 +/- ##
=======================================
Coverage 84.82% 84.82%
=======================================
Files 77 77
Lines 1562 1562
Branches 143 143
=======================================
Hits 1325 1325
Misses 180 180
Partials 57 57 |
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
The Lint Markdown push job compares
github.event.beforewithgithub.sha. After a force-push,beforepoints at a commit the runner can't resolve, sogit difffails withfatal: bad object(seen on #138's rebase push). When the before commit is missing (a new branch or a force-push), the step now lints every Markdown file the branch changes since it leftmain(origin/main...<sha>), not only the tip commit.This commit was meant for #138, but auto-merge squashed that PR two seconds before the commit reached GitHub.
Validation
yamllint .github/workflows/lint-markdown.yml: clean🤖 Generated with Claude Code