From 248b65537e7e55f068260df6ab76af9705e23bb8 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 2 Oct 2021 20:06:09 +0100 Subject: [PATCH] :construction_worker: Update PR size checker, with strip hash regex, and custom tags --- .github/workflows/get-size.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/get-size.yml b/.github/workflows/get-size.yml index ddca2cdb..11cb93fd 100644 --- a/.github/workflows/get-size.yml +++ b/.github/workflows/get-size.yml @@ -1,5 +1,5 @@ # Adds a comment to new PRs, showing the compressed size and size difference of new code -# And labels the PR based on the number of lines changes +# And also labels the PR based on the number of lines changes name: 🌈 Check PR Size on: [pull_request] jobs: @@ -13,7 +13,10 @@ jobs: uses: preactjs/compressed-size-action@v2 with: repo-token: ${{ secrets.BOT_GITHUB_TOKEN }} - pattern: "./dist/**/**" + pattern: './dist/**/*.{js,css,html}' + strip-hash: '\\b\\w{8}\\.' + exclude: '{./dist/manifest.json,**/*.map,**/node_modules/**}' + minimum-change-threshold: 100 # Check number of lines of code added - name: Label based on Lines of Code uses: codelytv/pr-size-labeler@v1 @@ -23,8 +26,13 @@ jobs: s_max_size: '100' m_max_size: '500' l_max_size: '1000' + s_label: '🟩 PR - Small' + m_label: '🟨 PR - Medium' + l_label: '🟧 PR - Large' + xl_label: '🟥 PR - XL' fail_if_xl: 'false' message_if_xl: > It looks like this PR is very large (over 1000 lines). Try to avoid addressing multiple issues in a single PR, and in the future consider breaking large tasks down into smaller steps. + This it to make reviewing, testing, reverting and general quality management easier.