{"id":22120974,"url":"https://github.com/actions-ecosystem/action-size","last_synced_at":"2025-07-25T13:31:47.974Z","repository":{"id":36955352,"uuid":"259943404","full_name":"actions-ecosystem/action-size","owner":"actions-ecosystem","description":"📏 GitHub Action to determine a label to be added based on PR's size","archived":false,"fork":false,"pushed_at":"2023-01-16T09:01:00.000Z","size":821,"stargazers_count":12,"open_issues_count":22,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-25T19:02:59.546Z","etag":null,"topics":["actions","github","label","pull-request"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/actions-ecosystem-size","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/actions-ecosystem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-29T14:09:21.000Z","updated_at":"2023-05-10T16:47:52.000Z","dependencies_parsed_at":"2023-01-17T08:17:00.233Z","dependency_job_id":null,"html_url":"https://github.com/actions-ecosystem/action-size","commit_stats":{"total_commits":34,"total_committers":4,"mean_commits":8.5,"dds":"0.23529411764705888","last_synced_commit":"6214b8fe14823f49c77fc983f3aa1b55a6065776"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/actions-ecosystem","download_url":"https://codeload.github.com/actions-ecosystem/action-size/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227482506,"owners_count":17779968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","github","label","pull-request"],"created_at":"2024-12-01T14:31:55.110Z","updated_at":"2024-12-01T14:32:02.642Z","avatar_url":"https://github.com/actions-ecosystem.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Action Size\n\n[![actions-workflow-test][actions-workflow-test-badge]][actions-workflow-test]\n[![release][release-badge]][release]\n[![license][license-badge]][license]\n\n![screenshot](./docs/assets/screenshot-add-label.png)\n![screenshot](./docs/assets/screenshot-remove-and-add-label.png)\n\nDetermine a label to be added based on the number of lines changed in a pull request.\n\nCounts the number of lines changed in a pull request.\nAnd buckets this number into a few size classes (S, L, XL, etc).\n\nIt would be better to work with other actions which add and remove labels.\nSee [the example below](#example) for detail.\n\nThis action is inspired by [Kubernetes Prow's size plugin](https://prow.k8s.io/plugins).\n\n## Note\n\nGitHub API implicitly creates a label when it will add the label to an issue or a pull request but the label doesn't exists.\nThe label has the default color and no description.\n\nIf you don't prefer the default label, it's better to create labels indicating a pull request size.\n\n## Inputs\n\nAll the inputs are optional.\n\n### Size labels\n\nThe inputs `size_${size}_label` indicates what name each label has.\n\n|         NAME         |         DESCRIPTION          |   TYPE   | REQUIRED |  DEFAULT   |\n|----------------------|------------------------------|----------|----------|------------|\n| `size_xs_label`      | The name for size XS label.  | `string` | `false`  | `size/XS`  |\n| `size_s_label`       | The name for size S label.   | `string` | `false`  | `size/S`   |\n| `size_m_label`       | The name for size M label.   | `string` | `false`  | `size/M`   |\n| `size_l_label`       | The name for size L label.   | `string` | `false`  | `size/L`   |\n| `size_xl_label`      | The name for size XL label.  | `string` | `false`  | `size/XL`  |\n| `size_xxl_label`     | The name for size XXL label. | `string` | `false`  | `size/XXL` |\n\n### Size thresholds\n\nThe inputs `size_${size}_threshold` indicates how many lines changed is corresponding to each label.\nMust be a minimal number, rather than a range.\n\n|         NAME         |         DESCRIPTION          |   TYPE   | REQUIRED |  DEFAULT   |\n|----------------------|------------------------------|----------|----------|------------|\n| `size_s_threshold`   | The threshold for size S.    | `number` | `false`  | `10`       |\n| `size_m_threshold`   | The threshold for size M.    | `number` | `false`  | `30`       |\n| `size_l_threshold`   | The threshold for size L.    | `number` | `false`  | `100`      |\n| `size_xl_threshold`  | The threshold for size XL.   | `number` | `false`  | `500`      |\n| `size_xxl_threshold` | The threshold for size XXL.  | `number` | `false`  | `1000`     |\n\n## Outputs\n\n|      NAME      |                                                                          DESCRIPTION                                                                           |   TYPE   |\n| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |\n| `new_label`    | The new label's name to be added. If there's no label to be added, it the value is `''`.                                                                       | `string` |\n| `stale_labels` | The stale labels' name to be removed. If there're multiple labels, they're separated by line breaks. If there's no labels to be removed, it the value is `''`. | `string` |\n\n## Example\n\nThis action works well with [actions-ecosystem/action-add-labels](https://github.com/actions-ecosystem/action-add-labels) and [actions-ecosystem/action-remove-labels](https://github.com/actions-ecosystem/action-remove-labels).\n\n```yaml\nname: Size\n\non:\n  pull_request:\n    types: [opened, synchronize]\n\njobs:\n  update_labels:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - uses: actions-ecosystem/action-size@v2\n        id: size\n\n      - uses: actions-ecosystem/action-remove-labels@v1\n        with:\n          github_token: ${{ secrets.github_token }}\n          labels: ${{ steps.size.outputs.stale_labels }}\n\n      - uses: actions-ecosystem/action-add-labels@v1\n        with:\n          github_token: ${{ secrets.github_token }}\n          labels: ${{ steps.size.outputs.new_label }}\n```\n\n## License\n\nCopyright 2020 The Actions Ecosystem Authors.\n\nAction Size is released under the [Apache License 2.0](./LICENSE).\n\n\u003c!-- badge links --\u003e\n\n[actions-workflow-test]: https://github.com/actions-ecosystem/action-size/actions?query=workflow%3ATest\n[actions-workflow-test-badge]: https://img.shields.io/github/workflow/status/actions-ecosystem/action-size/Test?label=Test\u0026style=for-the-badge\u0026logo=github\n\n[release]: https://github.com/actions-ecosystem/action-size/releases\n[release-badge]: https://img.shields.io/github/v/release/actions-ecosystem/action-size?style=for-the-badge\u0026logo=github\n\n[license]: LICENSE\n[license-badge]: https://img.shields.io/github/license/actions-ecosystem/action-size?style=for-the-badge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions-ecosystem%2Faction-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factions-ecosystem%2Faction-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions-ecosystem%2Faction-size/lists"}