cu25 for 2022 (do Build) #2251
Workflow file for this run
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
| name: Check repo size | |
| on: [pull_request] | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| clone: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - uses: jwalton/gh-find-current-pr@v1 | |
| id: findpr | |
| with: | |
| state: all | |
| - name: Repository size should be less than 105000 KiB | |
| env: | |
| PR: ${{ steps.findpr.outputs.pr }} | |
| shell: pwsh | |
| run: | | |
| cd /tmp | |
| gh repo clone dataplat/dbatools | |
| cd /tmp/dbatools | |
| Write-Output "Checking out $env:PR" | |
| gh pr checkout $env:PR | |
| $objects = git count-objects -v | |
| $sizepack = $objects -split '`n' | Where-Object { $PSItem -match "size-pack" } | |
| $size = [int]($sizepack -split " " | Select-Object -Last 1) | |
| Write-Output "Repo size is $size" | |
| # old size = 110299 or 250000+ | |
| if ($size -gt 105000) { # Size is 96250, so 105000 keeps headroom while catching old clones | |
| throw "This clone is outdated. Please reclone your repo and resubmit with the slimmed down repo. See https://github.com/dataplat/dbatools/pull/8637 for more information." | |
| } |