https://github.com/christianncode/pr-total-changes
Get a summary of the total number of changes in a pull request
https://github.com/christianncode/pr-total-changes
actions pr utilities workflow
Last synced: 11 months ago
JSON representation
Get a summary of the total number of changes in a pull request
- Host: GitHub
- URL: https://github.com/christianncode/pr-total-changes
- Owner: christianncode
- License: mit
- Created: 2025-06-17T17:40:23.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-30T17:33:27.000Z (12 months ago)
- Last Synced: 2025-06-30T18:32:06.635Z (12 months ago)
- Topics: actions, pr, utilities, workflow
- Language: JavaScript
- Homepage:
- Size: 1.25 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PR Total Changes
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.
## Features
- Calculates lines added, removed, and total changes in a PR.
- Comments a summary table on the pull request.
- Warns if the PR exceeds configurable limits for additions, deletions, or total changes.
## Usage
Add the following step to your workflow:
```yaml
- name: PR Total Changes
uses: christianncode/pr-total-changes@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# additions_limit: 1000
# deletions_limit: 1000
# total_limit: 500
```
## Inputs
| Name | Description | Required | Default |
| --------------- | ----------------------------------------------- | -------- | ------- |
| github_token | GitHub token with read access to the repository | true | |
| additions_limit | Maximum number of additions allowed in the PR | false | |
| deletions_limit | Maximum number of deletions allowed in the PR | false | |
| total_limit | Total number of changes to consider for the PR | false | 500 |
## Example Output
The action will comment something like:
```
### 📊 Code Changes Summary
| Lines Added | Lines Removed | Total Changes |
|-------------|---------------|---------------|
| 123 | 45 | 168 |
### ➡️ Configurations (Inputs)
| Additions Limit | Deletions Limit | Total Limit |
|-----------------|-----------------|-------------|
| 1000 | 1000 | 500 |
✅ **The PR is within the acceptable limit.**
```
If any limit is exceeded:
```
❌ **Too many additions! The PR exceeds the limit of 1000 lines added.**
❌ **Too many deletions! The PR exceeds the limit of 1000 lines removed.**
❌ **Too many changes! The PR exceeds the limit of 500 lines.**
```
## License
[MIT](LICENSE)
---
Made with ❤️ by [Christian Díaz](https://github.com/christianncode)