| 1 | 1 | # Adds a commentlabels to newpull PRs,requests showingbased theon compressedthe size and sizeof differencethe ofchanges new(changed codelines) |
| 2 | | -# And also labels the PR based on the number of lines changes |
| 2 | + |
| 3 | +# 🏷 Pull Request Size Labeler |
| 4 | +# https://github.com/marketplace/actions/pull-request-size-labeler |
| 5 | + |
| 6 | +name: 🌈 Label PR Size |
| 3 | 7 | |
| 4 | | -name: 🌈 Check PR Size |
| 5 | 8 | on: [pull_request] |
| 9 | + |
| 6 | 10 | jobs: |
| 7 | 11 | buildlabeler: |
| 12 | + permissions: |
| 13 | + pull-requests: write |
| 14 | + contents: read |
| 15 | + issues: write |
| 8 | 16 | runs-on: ubuntu-latest |
| 17 | + name: Label the PR size |
| 9 | 18 | steps: |
| 10 | | - - name: Checkout |
| 19 | + - uses: codelytv/pr-size-labeler@v1 |
| 11 | | - uses: actions/checkout@v2 |
| 12 | | - # Find and comment with compressed size |
| 13 | | - - name: Get Compressed Size |
| 14 | | - uses: preactjs/compressed-size-action@v2 |
| 15 | | - with: |
| 16 | | - repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} |
| 17 | | - pattern: './dist/**/*.{js,css,html}' |
| 18 | | - strip-hash: '\\b\\w{8}\\.' |
| 19 | | - exclude: '**/node_modules/**' |
| 20 | | - minimum-change-threshold: 100 |
| 21 | | - # Check number of lines of code added |
| 22 | | - - name: Label based on Lines of Code |
| 23 | | - uses: codelytv/pr-size-labeler@v1 |
| 24 | 20 | with: |
| 25 | 21 | GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} |
| 26 | | - xs_max_size: '10' |
| 22 | + xs_label: 'PR - Small' |
| 23 | + xs_max_size: '1' |
| 24 | + s_label: 'PR - Small' |
| 27 | 25 | s_max_size: '100' |
| 26 | + m_label: 'PR - Medium' |
| 28 | 27 | m_max_size: '500' |
| 28 | + l_label: 'PR - Large' |
| 29 | 29 | l_max_size: '1000' |
| 30 | 30 | s_label xl_label: '🟩 PR - SmallXL' |
| 31 | | - m_label: '🟨 PR - Medium' |
| 32 | | - l_label: '🟧 PR - Large' |
| 33 | | - xl_label: '🟥 PR - XL' |
| 34 | 31 | fail_if_xl: 'false' |
| 35 | 32 | message_if_xl: > |
| 36 | | - It looks like this PR is very large (over 1000 lines). |
| 37 | | - Try to avoid addressing multiple issues in a single PR, and |
| 38 | | - in the future consider breaking large tasks down into smaller steps. |
| 39 | | - This it to make reviewing, testing, reverting and general quality management easier. |
| 39 | |
\ No newline at end of file |
| 33 | + This PR exceeds the recommended size of 1000 lines. |
| 34 | + Please make sure you are not addressing multiple issues with one PR. |
| 35 | + Note this PR might be rejected due to its size. |
| 36 | + github_api_url: 'https://api.github.com' |
| 37 | + files_to_ignore: | |
| 38 | + "package-lock.json" |
| 39 | + "public/lib/*" |