{"id":15532133,"url":"https://github.com/endbug/label-sync","last_synced_at":"2025-07-21T09:32:03.002Z","repository":{"id":37249460,"uuid":"302251027","full_name":"EndBug/label-sync","owner":"EndBug","description":":octocat: An action that allows you to sync labels from a repository or a config file","archived":false,"fork":false,"pushed_at":"2025-01-02T10:41:40.000Z","size":2843,"stargazers_count":32,"open_issues_count":7,"forks_count":12,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-07T04:52:21.522Z","etag":null,"topics":["actions","ci","github","hacktoberfest","labels","repository","sync","utility","workflow"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/EndBug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["endbug"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-10-08T06:27:45.000Z","updated_at":"2025-05-31T09:11:37.000Z","dependencies_parsed_at":"2023-10-04T17:52:41.374Z","dependency_job_id":"cc465937-ea21-4152-be1e-0410c7b43c10","html_url":"https://github.com/EndBug/label-sync","commit_stats":{"total_commits":302,"total_committers":13,"mean_commits":23.23076923076923,"dds":"0.26490066225165565","last_synced_commit":"4227d8db349126b59efdbebf7842b032f4fe430a"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/EndBug/label-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndBug%2Flabel-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndBug%2Flabel-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndBug%2Flabel-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndBug%2Flabel-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EndBug","download_url":"https://codeload.github.com/EndBug/label-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndBug%2Flabel-sync/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266275927,"owners_count":23903950,"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","ci","github","hacktoberfest","labels","repository","sync","utility","workflow"],"created_at":"2024-10-02T11:29:16.002Z","updated_at":"2025-07-21T09:32:02.975Z","avatar_url":"https://github.com/EndBug.png","language":"TypeScript","readme":"# label-sync\n[![All Contributors](https://img.shields.io/github/all-contributors/EndBug/label-sync)](#contributors-)\n\nAn action that allows you to sync labels from a repository or a config file.\n\n### Example workflow:\n\n```yaml\nname: Sync labels\non:\n  # You can run this with every type of event, but it's better to run it only when you actually need it.\n  workflow_dispatch:\n\npermissions:\n  issues: write\n\njobs:\n  labels:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          sparse-checkout: .github/labels.yml\n\n      - uses: EndBug/label-sync@v2\n        with:\n          # If you want to use a config file, you can put its path or URL here, multiple files are also allowed (more info in the paragraphs below)\n          config-file: .github/labels.yml\n          # as URL:\n          config-file: https://raw.githubusercontent.com/EndBug/labels/main/labels.yml\n          # as multiple:\n          config-file: |\n            https://raw.githubusercontent.com/EndBug/labels/main/labels.yml\n            .github/labels.yml\n\n          # If you want to use a source repo, you can put is name here (only the owner/repo format is accepted)\n          source-repo: owner/repo\n\n          # If you're using a private source repo or a URL that needs an 'Authorization' header, you'll need to add a custom token for the action to read it\n          request-token: ${{ secrets.YOUR_OWN_SECRET }}\n\n          # If you want to delete any additional label, set this to true\n          delete-other-labels: false\n\n          # If you want the action just to show you the preview of the changes, without actually editing the labels, set this to true\n          dry-run: true\n\n          # You can change the token used to change the labels, this is the default one\n          token: ${{ secrets.GITHUB_TOKEN }}\n```\n\nThis is only a sample workflow to illustrate all the options: if you want to see an actual workflow you can check out the one in this repo [here](.github/workflows/labels.yml).\n\n### Config files\n\nIf you want to use a config file you can create your own following the instructions below.\n\nIf you want to start off by copying the labels from another repository, you can use my [`EndBug/export-label-config` action](https://github.com/EndBug/export-label-config), that will generate one for you.\n\nHow to create a config file:\n\n- Create a JSON or YAML file, with one of these extensions: `.json`, `.yaml`, `.yml`.\n- Every label should be an array element: add some square brackets `[]` if you need to.\n- Every element of the array should be an object with the following properties:\n  - `name` - The name of the label.\n  - `color` - The color of the label, with or without a leading `#`.\n  - `description` - [optional] The description of the label ([max 100 characters](https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#create-a-label)).\n  - `aliases` - [optional] An array containing the \"aliases\" of the label. If an existing label's name is an alias that label will be edited to match your config: this way you don't loose issues and PRs that have been labeled previously.\n\nThis is how it would end up looking:\n\n```yaml\n- name: A label\n  color: '000000'\n\n- name: Another label\n  color: '111111'\n  description: A very inspiring description\n\n- name: Yet another label\n  color: '222222'\n  aliases: ['first', 'second', 'third']\n```\n\n```json\n[\n  {\n    \"name\": \"A label\",\n    \"color\": \"000000\"\n  },\n  {\n    \"name\": \"Another label\",\n    \"color\": \"111111\",\n    \"description\": \"A very inspiring description\"\n  },\n  {\n    \"name\": \"Yet another label\",\n    \"color\": \"222222\",\n    \"aliases\": [\"first\", \"second\", \"third\"]\n  }\n]\n```\n\nNote that `color` may be specified in either `000000` or `'#000000'` format. Mind the quotes when using yaml.\n\nIf you want to see an actual config file, you can check out the one in this repo [here](https://github.com/EndBug/labels/blob/main/labels.yml).\n\nThis action can either read a local file or fetch it from a custom URL.  \nIf you want to use a URL make sure that the data field of the response contains JSON or YAML text that follows the structure above.\n\nAn example of how you may want to use a URL instead of a local file is if you want to use a config file that is located in a GitHub repo, without having to copy it to your own.  \nYou can use the \"raw\" link that GitHub provides for the file:\n\n```yaml\n- uses: EndBug/label-sync@v2\n  with:\n    # This is just an example, but any valid URL can be used\n    config-file: 'https://raw.githubusercontent.com/EndBug/labels/main/labels.yml'\n```\n\nYou can also specify several config files (e.g. sync a set of \"global\" labels as well as a set of \"local\" labels):\n\n```yaml\n- uses: EndBug/label-sync@v2\n  with:\n    config-file: |\n        https://raw.githubusercontent.com/EndBug/labels/main/labels.yml\n        .github/labels.yml\n```\n\nThis is different than using the `source-repo` option, since this also allows you to use aliases, if the config file has any. If you use the `source-repo` option the action will only copy over the missing labels and update colors, without updating or deleting anything else.\n\nIf the URL you're using needs an `Authorization` header (like if, for example, you're fetching it from a private repo), you can put its value in the `request-token` input:\n\n```yaml\n- uses: EndBug/label-sync@v2\n  with:\n    config-file: 'https://raw.githubusercontent.com/User/repo-name/path/to/labels.yml'\n    # Remember not to put PATs in files, use GitHub secrets instead\n    request-token: ${{ secrets.YOUR_CUSTOM_PAT }}\n```\n\nThe `request-token` input can also be used with a `source-repo`, if that repo is private.\n\nIf your URL needs a more elaborate request, it's better if you perform it separately and save its output to a local file. You can then run the action using the local config file you just created.\n\n## Contributors ✨\n\nThanks go to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/EndBug\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/26386270?v=4?s=100\" width=\"100px;\" alt=\"Federico Grandi\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFederico Grandi\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/commits?author=EndBug\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/h1dden-da3m0n\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/33120068?v=4?s=100\" width=\"100px;\" alt=\"K3rnelPan1c\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eK3rnelPan1c\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/commits?author=h1dden-da3m0n\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/danielwerg\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/35052399?v=4?s=100\" width=\"100px;\" alt=\"danielwerg\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003edanielwerg\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/commits?author=danielwerg\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/kenodegard\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/4546435?v=4?s=100\" width=\"100px;\" alt=\"Ken Odegard\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKen Odegard\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/commits?author=kenodegard\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/armsnyder\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/9969202?v=4?s=100\" width=\"100px;\" alt=\"Adam Snyder\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdam Snyder\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/commits?author=armsnyder\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://srealmoreno.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/50985135?v=4?s=100\" width=\"100px;\" alt=\"Salvador real\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSalvador real\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/commits?author=srealmoreno\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://simbo.de/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/647390?v=4?s=100\" width=\"100px;\" alt=\"Simon Lepel\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSimon Lepel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/commits?author=simbo\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://www.linkedin.com/in/carlosrodriguezhernandez/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/13216600?v=4?s=100\" width=\"100px;\" alt=\"Carlos Rodríguez Hernández\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eCarlos Rodríguez Hernández\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/commits?author=carrodher\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/MaddoScientisto\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/816014?v=4?s=100\" width=\"100px;\" alt=\"Marco\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMarco\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/issues?q=author%3AMaddoScientisto\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/andrewvaughan\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1119590?v=4?s=100\" width=\"100px;\" alt=\"Andrew Vaughan\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAndrew Vaughan\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/commits?author=andrewvaughan\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://linkedin.com/in/reece\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/109453?v=4?s=100\" width=\"100px;\" alt=\"Reece Hart\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eReece Hart\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-reece\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://th3s4mur41.me\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/5543595?v=4?s=100\" width=\"100px;\" alt=\"Michaël Vanderheyden\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMichaël Vanderheyden\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/EndBug/label-sync/issues?q=author%3ATh3S4mur41\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","funding_links":["https://github.com/sponsors/endbug"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendbug%2Flabel-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendbug%2Flabel-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendbug%2Flabel-sync/lists"}