{"id":15692312,"url":"https://github.com/cbrgm/pr-size-labeler-action","last_synced_at":"2025-05-07T23:23:20.184Z","repository":{"id":209640350,"uuid":"724591626","full_name":"cbrgm/pr-size-labeler-action","owner":"cbrgm","description":"Automatically labels pull requests in your GitHub repository based on the size of changes.","archived":false,"fork":false,"pushed_at":"2025-05-01T12:14:26.000Z","size":125,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-05T01:05:05.762Z","etag":null,"topics":["action","gihub-actions","github","go","labels","pull-requests","size"],"latest_commit_sha":null,"homepage":"https://cbrgm.net","language":"Go","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/cbrgm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"chrisbargmann"}},"created_at":"2023-11-28T11:53:28.000Z","updated_at":"2025-04-22T13:07:58.000Z","dependencies_parsed_at":"2023-12-17T02:25:00.312Z","dependency_job_id":"4bb49550-8736-4e5a-b445-cbd97522dbc6","html_url":"https://github.com/cbrgm/pr-size-labeler-action","commit_stats":{"total_commits":93,"total_committers":4,"mean_commits":23.25,"dds":0.6344086021505376,"last_synced_commit":"2118f43a35bcbba2826fe648e751ab8f5e981b97"},"previous_names":["cbrgm/pr-size-labeler-action"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fpr-size-labeler-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fpr-size-labeler-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fpr-size-labeler-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fpr-size-labeler-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbrgm","download_url":"https://codeload.github.com/cbrgm/pr-size-labeler-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252969061,"owners_count":21833404,"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":["action","gihub-actions","github","go","labels","pull-requests","size"],"created_at":"2024-10-03T18:31:21.651Z","updated_at":"2025-05-07T23:23:20.167Z","avatar_url":"https://github.com/cbrgm.png","language":"Go","funding_links":["https://ko-fi.com/chrisbargmann"],"categories":[],"sub_categories":[],"readme":"# PR Size Labeler GitHub Action\n\n**Automatically labels pull requests in your GitHub repository based on the size of changes.**\n\n[![GitHub release](https://img.shields.io/github/release/cbrgm/pr-size-labeler-action.svg)](https://github.com/cbrgm/pr-size-labeler-action)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cbrgm/pr-size-labeler-action)](https://goreportcard.com/report/github.com/cbrgm/pr-size-labeler-action)\n[![go-lint-test](https://github.com/cbrgm/cbrgm-pr-size-labeler-action/actions/workflows/go-lint-test.yml/badge.svg)](https://github.com/cbrgm/cbrgm-pr-size-labeler-action/actions/workflows/go-lint-test.yml)\n[![go-binaries](https://github.com/cbrgm/cbrgm-pr-size-labeler-action/actions/workflows/go-binaries.yml/badge.svg)](https://github.com/cbrgm/cbrgm-pr-size-labeler-action/actions/workflows/go-binaries.yml)\n[![container](https://github.com/cbrgm/cbrgm-pr-size-labeler-action/actions/workflows/container.yml/badge.svg)](https://github.com/cbrgm/cbrgm-pr-size-labeler-action/actions/workflows/container.yml)\n\n## Container Usage\n\nThis action can be executed independently from workflows within a container. To do so, use the following command:\n\n```\npodman run --rm -it ghcr.io/cbrgm/pr-size-labeler-action:v1 --help\n```\n\n## Workflow Usage\n\nBefore using this action, ensure you have a [`.github/pull-request-size.yml`](.github/pull-request-size.yml) configuration file in your repository. This file should define the size thresholds and corresponding labels.\n\nAdd the following step to your GitHub Actions Workflow:\n\n```yaml\nname: PR Size Labeler\n\non:\n  pull_request: # Trigger the workflow when a pull request is opened or synchronized\n\njobs:\n  auto-label-pr:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Repository\n        uses: actions/checkout@v2 # Checkout the repository code\n      - name: Label PR based on size\n        uses: cbrgm/pr-size-labeler-action@main\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }} # Pass the GitHub token for authentication\n          github_repository: ${{ github.repository }} # Pass the repository name\n          github_pr_number: ${{ github.event.number }} # Pass the pull request number\n          config_file_path: '.github/pull-request-size.yml' # Specify the path to the configuration file\n```\n\n## Example Config\n\n```yml\n# Configuration for PR Size Labeler\n\n# List of files to exclude from size calculation\n# Files matching these patterns will not be considered when calculating PR size\nexclude_files:\n  - \"foo.bar\"  # Example: Exclude 'foo.bar' file\n  - \"*.xyz\"\n\n# Configuration for labeling based on the size of the Pull Request\n# Each entry defines a size label, along with thresholds for diff and file count\nlabel_configs:\n  # Configuration for 'extra small' PRs\n  - size: xs\n    diff: 25    # Threshold for the total lines of code changed (additions + deletions)\n    files: 1    # Threshold for the total number of files changed\n    labels: [\"size/xs\"]  # Labels to be applied for this size\n\n  # Configuration for 'small' PRs\n  - size: s\n    diff: 150\n    files: 10\n    labels: [\"size/s\"]\n\n  # Configuration for 'medium' PRs\n  - size: m\n    diff: 600\n    files: 25\n    labels: [\"size/m\", \"pairing-wanted\"]\n\n  # Configuration for 'large' PRs\n  - size: l\n    diff: 2500\n    files: 50\n    labels: [\"size/l\", \"pairing-wanted\"]\n\n  # Configuration for 'extra large' PRs\n  - size: xl\n    diff: 5000\n    files: 100\n    labels: [\"size/xl\", \"pairing-wanted\"]\n```\n\n### Local Development\n\nYou can build this action from source using `Go`:\n\n```bash\nmake build\n```\n\n#### High-Level Functionality\n\n```mermaid\nsequenceDiagram\n    participant GitHubAction as pr-size-labeler-action\n    participant GitHubAPI\n\n    Note over GitHubAction, GitHubAPI: GitHub Action: Pull Request Size Labeler\n\n    GitHubAction-\u003e\u003eGitHubAPI: Initialize GitHub Client\n    activate GitHubAPI\n    GitHubAPI--\u003e\u003eGitHubAction: Client Initialized\n    deactivate GitHubAPI\n\n    GitHubAction-\u003e\u003eGitHubAPI: Fetch PR Files\n    activate GitHubAPI\n    GitHubAPI--\u003e\u003eGitHubAction: PR Files Returned\n    deactivate GitHubAPI\n\n    GitHubAction-\u003e\u003eGitHubAction: Calculate Size and Diff\n\n    GitHubAction-\u003e\u003eGitHubAPI: Update PR Labels\n    activate GitHubAPI\n    GitHubAPI--\u003e\u003eGitHubAction: PR Labels Updated\n    deactivate GitHubAPI\n\n    GitHubAction-\u003e\u003eGitHubAction: Action Completed\n\n```\n\n## Contributing \u0026 License\n\n* **Contributions Welcome!**: Interested in improving or adding features? Check our [Contributing Guide](https://github.com/cbrgm/pr-size-labeler-action/blob/main/CONTRIBUTING.md) for instructions on submitting changes and setting up development environment.\n* **Open-Source \u0026 Free**: Developed in my spare time, available for free under [Apache 2.0 License](https://github.com/cbrgm/pr-size-labeler-action/blob/main/LICENSE). License details your rights and obligations.\n* **Your Involvement Matters**: Code contributions, suggestions, feedback crucial for improvement and success. Let's maintain it as a useful resource for all 🌍.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrgm%2Fpr-size-labeler-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbrgm%2Fpr-size-labeler-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrgm%2Fpr-size-labeler-action/lists"}