Get a summary of the total number of changes (additions and deletions) in a pull request, and automatically comment on the PR with the results.
- Calculates lines added, removed, and total changes in a PR.
- Comments a summary table on the pull request.
- Warns if the PR exceeds the configured total changes limit.
Add the following step to your workflow:
- name: PR Total Changes
uses: christianncode/pr-total-changes@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# total_limit: 500| Name | Description | Required | Default |
|---|---|---|---|
| github_token | GitHub token with read access to the repository | true | |
| total_limit | Total number of changes to consider for the PR | false | 500 |
The action will comment something like:
### 📊 Code Changes Summary
| Lines Added | Lines Removed | Total Changes |
|-------------|---------------|---------------|
| 123 | 45 | 168 |
### ➡️ Configurations (Inputs)
| Total Limit |
|-------------|
| 500 |
✅ **The PR is within the acceptable limit.**
If the limit is exceeded:
❌ **Too many changes! The PR exceeds the limit of 500 lines.**
Made with ❤️ by Christian Díaz