You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
refactor: count PR lines from the GitHub API instead of a git checkout (#273)
* feat: add base branch resolution step in PR line check action
This update introduces a new step to resolve the current pull request's base branch dynamically. It ensures that the action uses the live base branch instead of potentially stale data from the webhook payload, improving accuracy in line calculations.
* fix: checkout PR head for accurate line counts against live base
Co-authored-by: Cursor <cursoragent@cursor.com>
* Update .github/actions/pr-line-check/action.yml
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
* fix: count lines against the resolved live base branch
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor: count PR lines from the API instead of a git checkout
The pull request files endpoint reports per-file additions and deletions
against the pull request's current base, which removes the need to check
out the repository, resolve the base branch and probe git history for a
merge base. It also makes the count immune to a webhook payload that lags
a base retarget, since only the pull request number comes from the event.
A pull request touching more than the 3000 files the endpoint lists is
labelled size-XL without counting lines, as it is over any limit anyway.
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs: add changelog entry for pr-line-check API counting
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs: add changelog entry for pr-line-check API counting
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix changelog
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Fixed
11
+
12
+
- Count changed lines in `pr-line-check` from the pull request files API, so the count always reflects the pull request's current base branch ([#273](https://github.com/MetaMask/github-tools/pull/273))
0 commit comments