Skip to content

Commit

Permalink
report repo size increase in pr description
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshuebner committed Dec 13, 2023
1 parent ee0281a commit fbd6027
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/update-test-runtime-statistics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
FIRST_LINE=$(git diff-tree -r -c -M -C --no-commit-id HEAD | head -n 1)
BLOB_HASH=$(echo $FIRST_LINE | awk '{print $4}')
SIZE=$(echo $BLOB_HASH | git cat-file --batch-check | grep "blob" | awk '{ print $3 }')
PRINTABLE_SIZE=$(numfmt --to=iec --suffix=B --format="%.1f" "$SIZE")
git config user.name "GitHub Actions Bot"
git config user.email "<[email protected]>"
git commit -m "chore(ci): updated test file runtime file" .ci/runtimes.json
git push -f origin HEAD:chore/update-runtimes
gh pr create --title "chore(ci): update test runtimes" \
--body "This PR updates the test runtimes file to incorporate latest statistics for better scheduling." \
--body "This PR updates the test runtimes file to incorporate latest statistics for better scheduling. It increases the repository size by $PRINTABLE_SIZE" \
--base master \
--head chore/update-runtimes
- name: Report repository size increase
run: |
FIRST_LINE=$(git diff-tree -r -c -M -C --no-commit-id HEAD | head -n 1)
BLOB_HASH=$(echo $FIRST_LINE | awk '{print $4}')
SIZE=$(echo $BLOB_HASH | git cat-file --batch-check | grep "blob" | awk '{ print $3 }')
echo The repository increased in size by $(numfmt --to=iec --suffix=B --format="%.1f" "$SIZE")

0 comments on commit fbd6027

Please sign in to comment.