Created
February 4, 2024 02:42
-
-
Save dafurman/b6ef7bb4c5d17e7e5ea6abe82370e1ee to your computer and use it in GitHub Desktop.
Count files changed in PRs
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
#!/bin/zsh | |
# Put this the repo you want to examine | |
if [ $# -eq 0 ]; then | |
echo "Please provide PR numbers as arguments." | |
exit 1 | |
fi | |
prs=("$@") | |
totalFiles=0 | |
for pr in "${prs[@]}"; do | |
files=$(gh pr diff "$pr" | diffstat -l | wc -l) | |
echo "Files changed for $pr: $files" | |
((totalFiles += files)) | |
done | |
echo "Total files changed for all prs: $totalFiles" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment