{"id":13474342,"url":"https://github.com/pascalgn/size-label-action","last_synced_at":"2025-05-16T18:07:10.282Z","repository":{"id":40750377,"uuid":"167853969","full_name":"pascalgn/size-label-action","owner":"pascalgn","description":"GitHub action to assign labels based on pull request change sizes","archived":false,"fork":false,"pushed_at":"2025-01-22T07:17:29.000Z","size":480,"stargazers_count":93,"open_issues_count":7,"forks_count":50,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-05T19:37:39.320Z","etag":null,"topics":["github","github-action","github-api","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pascalgn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-27T20:17:11.000Z","updated_at":"2025-02-01T18:56:03.000Z","dependencies_parsed_at":"2024-04-16T19:40:58.881Z","dependency_job_id":"976b0592-6831-48a2-96a7-6473269c7752","html_url":"https://github.com/pascalgn/size-label-action","commit_stats":{"total_commits":70,"total_committers":15,"mean_commits":4.666666666666667,"dds":0.2142857142857143,"last_synced_commit":"6ec5bd0f81af1bd8d691180fbf04453b2c4b1642"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fsize-label-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fsize-label-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fsize-label-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fsize-label-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pascalgn","download_url":"https://codeload.github.com/pascalgn/size-label-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253932933,"owners_count":21986479,"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":["github","github-action","github-api","hacktoberfest"],"created_at":"2024-07-31T16:01:11.625Z","updated_at":"2025-05-16T18:07:10.240Z","avatar_url":"https://github.com/pascalgn.png","language":"JavaScript","readme":"# size-label-action\n\nGitHub action to assign labels based on pull request change sizes.\n\nLabels are taken from https://github.com/kubernetes/kubernetes/labels?q=size\n\n## Usage\n\nCreate a `.github/workflows/size-label.yml` file:\n\n```yaml\nname: size-label\non: pull_request_target\njobs:\n  size-label:\n    permissions:\n      contents: read\n      pull-requests: write\n    runs-on: ubuntu-latest\n    steps:\n      - name: size-label\n        uses: \"pascalgn/size-label-action@v0.5.5\"\n        env:\n          GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n```\n\n## Create the needed labels\n\nExport both `GITHUB_TOKEN` and `REPO` (e.g. `my-username/my-repository`) and run the script below:\n\n```bash\nfor size in XL XXL XS S M L; do\n  curl -sf -H \"Authorization: Bearer $GITHUB_TOKEN\" \"https://api.github.com/repos/kubernetes/kubernetes/labels/size/$size\" |\n    jq '. | { \"name\": .name, \"color\": .color, \"description\": .description }' |\n    curl -sfXPOST -d @- -H \"Authorization: Bearer $GITHUB_TOKEN\" https://api.github.com/repos/$REPO/labels\ndone\n```\n\n## Configuration\n\nThe following optional environment variables are supported:\n\n- `IGNORED`: A list of [glob expressions](http://man7.org/linux/man-pages/man7/glob.7.html)\n  separated by newlines. Files matching these expressions will not count when\n  calculating the change size of the pull request. Lines starting with `#` are\n  ignored and files matching lines starting with `!` are always included.\n- `HTTPS_PROXY`: A proxy URL to pass to [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent)\n  which will be used to proxy requests to the GitHub API.\n\nYou can configure the environment variables in the workflow file like this:\n\n```yaml\n        env:\n          GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n          IGNORED: \".*\\n!.gitignore\\nyarn.lock\\ngenerated/**\"\n```\n\n## Custom sizes\n\nThe default sizes are:\n\n```js\n{\n  \"0\": \"XS\",\n  \"10\": \"S\",\n  \"30\": \"M\",\n  \"100\": \"L\",\n  \"500\": \"XL\",\n  \"1000\": \"XXL\"\n}\n```\n\nYou can pass your own configuration by passing `sizes`\n\n```yaml\nname: size-label\non: pull_request_target\njobs:\n  size-label:\n    permissions:\n      contents: read\n      pull-requests: write\n    runs-on: ubuntu-latest\n    steps:\n      - name: size-label\n        uses: \"pascalgn/size-label-action@v0.5.5\"\n        env:\n          GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n        with:\n          sizes: \u003e\n            {\n              \"0\": \"XS\",\n              \"20\": \"S\",\n              \"50\": \"M\",\n              \"200\": \"L\",\n              \"800\": \"XL\",\n              \"2000\": \"XXL\"\n            }\n```\n\n## Using with other actions\n\nIf creating workflow with multiple jobs, they can react on the label set by this action:\n\n```yaml\nname: size-label\non: pull_request_target\njobs:\n  label:\n    permissions:\n      contents: read\n      pull-requests: write\n    runs-on: ubuntu-latest\n    outputs:\n      label: ${{ steps.label.outputs.sizeLabel }}\n    steps:\n      - name: size-label\n        id: label\n        uses: \"pascalgn/size-label-action@v0.5.5\"\n        env:\n          GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n  comment:\n    runs-on: ubuntu-latest\n    needs: label\n    if: ${{ contains(needs.label.outputs.label, 'XL') }}\n    steps:\n      - run: echo \"Too big PR\"\n```\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":["Community Resources","JavaScript"],"sub_categories":["Pull Requests"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalgn%2Fsize-label-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpascalgn%2Fsize-label-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalgn%2Fsize-label-action/lists"}