mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Update PR size workflow
This commit is contained in:
54
.github/workflows/get-pr-size.yml
vendored
54
.github/workflows/get-pr-size.yml
vendored
@@ -1,39 +1,39 @@
|
|||||||
# Adds a comment to new PRs, showing the compressed size and size difference of new code
|
# Adds labels to pull requests based on the size of the changes (changed lines)
|
||||||
# And also labels the PR based on the number of lines changes
|
|
||||||
|
# 🏷 Pull Request Size Labeler
|
||||||
|
# https://github.com/marketplace/actions/pull-request-size-labeler
|
||||||
|
|
||||||
|
name: 🌈 Label PR Size
|
||||||
|
|
||||||
name: 🌈 Check PR Size
|
|
||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
labeler:
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: read
|
||||||
|
issues: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
name: Label the PR size
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: codelytv/pr-size-labeler@v1
|
||||||
uses: actions/checkout@v2
|
|
||||||
# Find and comment with compressed size
|
|
||||||
- name: Get Compressed Size
|
|
||||||
uses: preactjs/compressed-size-action@v2
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
|
|
||||||
pattern: './dist/**/*.{js,css,html}'
|
|
||||||
strip-hash: '\\b\\w{8}\\.'
|
|
||||||
exclude: '**/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
|
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
xs_max_size: '10'
|
xs_label: 'PR - Small'
|
||||||
|
xs_max_size: '1'
|
||||||
|
s_label: 'PR - Small'
|
||||||
s_max_size: '100'
|
s_max_size: '100'
|
||||||
|
m_label: 'PR - Medium'
|
||||||
m_max_size: '500'
|
m_max_size: '500'
|
||||||
|
l_label: 'PR - Large'
|
||||||
l_max_size: '1000'
|
l_max_size: '1000'
|
||||||
s_label: '🟩 PR - Small'
|
xl_label: 'PR - XL'
|
||||||
m_label: '🟨 PR - Medium'
|
|
||||||
l_label: '🟧 PR - Large'
|
|
||||||
xl_label: '🟥 PR - XL'
|
|
||||||
fail_if_xl: 'false'
|
fail_if_xl: 'false'
|
||||||
message_if_xl: >
|
message_if_xl: >
|
||||||
It looks like this PR is very large (over 1000 lines).
|
This PR exceeds the recommended size of 1000 lines.
|
||||||
Try to avoid addressing multiple issues in a single PR, and
|
Please make sure you are not addressing multiple issues with one PR.
|
||||||
in the future consider breaking large tasks down into smaller steps.
|
Note this PR might be rejected due to its size.
|
||||||
This it to make reviewing, testing, reverting and general quality management easier.
|
github_api_url: 'https://api.github.com'
|
||||||
|
files_to_ignore: |
|
||||||
|
"package-lock.json"
|
||||||
|
"public/lib/*"
|
||||||
|
Reference in New Issue
Block a user