Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/srealmoreno/label-sync-action
Keeps your labels in sync in a GitHub repo(s) from a config file. Manage all tags from all your repositories in a single place.
https://github.com/srealmoreno/label-sync-action
ci github-actions label-sync workflow
Last synced: about 1 month ago
JSON representation
Keeps your labels in sync in a GitHub repo(s) from a config file. Manage all tags from all your repositories in a single place.
- Host: GitHub
- URL: https://github.com/srealmoreno/label-sync-action
- Owner: srealmoreno
- License: mit
- Created: 2022-06-19T06:15:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-27T17:25:37.000Z (about 2 months ago)
- Last Synced: 2024-09-28T11:23:45.258Z (about 2 months ago)
- Topics: ci, github-actions, label-sync, workflow
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/label-sync-action
- Size: 662 KB
- Stars: 0
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: docs/CODE_OF_CONDUCT.md
- Security: docs/SECURITY.md
Awesome Lists containing this project
README
[tags]: https://github.com/srealmoreno/label-sync-action/tags
[wiki]: https://github.com/srealmoreno/label-sync-action/wiki
[contributors]:https://github.com/srealmoreno/label-sync-action/graphs/contributors
[Personal Access Token]: https://github.com/settings/tokens/new# Label Sync Action [![Codacy Badge](https://app.codacy.com/project/badge/Grade/2e47ea97e1e546afab645674825e0122)](https://www.codacy.com/gh/srealmoreno/label-sync-action/dashboard?utm_source=github.com&utm_medium=referral&utm_content=srealmoreno/label-sync-action&utm_campaign=Badge_Grade)
Label Sync Action is a simple action that syncs labels to a GitHub repository or
list of repositories.Manage all tags from all your repositories in a single place.
## ๐ Getting Started
### Create a config file ๐
The default file path is `.github/labels.yml`, but you can specify a different path
see options below.How to create a config file:
- Create a JSON or YAML file, with one of these extensions: `.json`, `.jsonc`, `.yaml`,
`.yml`.
- Every label should be an array element: add some square brackets `[]` if you need
to.
- Every element of the array should be an object with the following properties:
- `name` - The name of the label.
- `color` - The color of the label.
- `description` - [optional] The description of the label.
- `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.```yaml
- name: breaking-change ๐ฅ
color: '#D93F0B'
description:
A change that changes the API or breaks backward compatibility for
users.
aliases: [breaking]- name: bug ๐
color: d73a4a
description:
Inconsistencies or issues which will cause a problem for users or implementors.- name: documentation ๐
color: 0075ca
description: Solely about the documentation of the project.
```> The `#` in `color` is optional.
```jsonc
[
// Support comments
{
// My label
"name": "breaking-change ๐ฅ",
"color": "#D93F0B",
"description":
"A change that changes the API or breaks backward compatibility for users.",
"aliases": [
"breaking"
]
},
{
"name": "bug ๐",
"color": "d73a4a",
"description":
"Inconsistencies or issues which will cause a problem for users or implementors."
},
{
"name": "documentation ๐",
"color": "0075ca",
"description": "Solely about the documentation of the project."
}
]
```> The `#` in `color` is optional.
### Create a workflow ๐
Sample basic workflow:
```yaml
name: โป๏ธ Sync Labelson:
workflow_dispatch:jobs:
labels:
name: โป๏ธ Sync labels
runs-on: ubuntu-22.04
steps:
- name: โคต๏ธ Check out code from GitHub
uses: actions/checkout@v3- name: ๐ Run Label Sync
uses: srealmoreno/label-sync-action@v2
```## ๐ Usage
### Sync labels to a list of repositories ๐ฆ
Specify a repository or a list of repositories
```yaml
...
- name: ๐ Run Label Sync
uses: srealmoreno/label-sync-action@v2
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}# Optional:
repositories: |
owner/repository-1
owner/repository-2# Optional:
config-file: |
.github/labels-1.yml
.github/labels-2.yml
https://raw.githubusercontent.com/srealmoreno/label-sync-action/main/.github/labels/labels.yml# Optional:
# Clean other labels not defined in the config file(s)
clean-labels: false
```> Note: The default `GITHUB_TOKEN` will not have permissions to
> write labels on other repositories so you must specify a [Personal Access Token]
> with access to repositories.### Get Labels of url ๐
It's possible to get the labels of url.
If you use only url, the `actions/checkout@v3` step is not necessary```yaml
...
steps:
- name: ๐ Run Label Sync
uses: srealmoreno/label-sync-action@v2
with:
config-file: https://raw.githubusercontent.com/srealmoreno/label-sync-action/main/.github/labels/labels.yml
```### Auto Discover Repositories ๐
If you have a very large list of repositories and you want to have the same
tags in all repositories you can use the `auto-discover-repos` option.```yaml
...
- name: ๐ Run Label Sync
uses: srealmoreno/label-sync-action@v2
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
auto-discover-repos: true# Optional:
exclude-repos: repo-1
# You can specify a array of the repositories to be excluded
exclude-repos: |
repository-1
repository-2
# You can specify regex to exclude repositories
exclude-repos: /^repository-1$/u# Optional:
account-type: org | user# Optional:
owner: owner# Optional:
exclude-forked-repos: true# Optional:
exclude-archived-repos: true# Optional:
exclude-private-repos: true# Optional:
exclude-disabled-repos: true
```## ๐ ๏ธ Built With
- [Node.js](https://nodejs.org)
- [TypeScript](https://www.typescriptlang.org)
- [Esbuild](https://esbuild.org)## ๐๏ธ Contributing
Please read [CONTRIBUTING](docs/CONTRIBUTING.md) for details on our code of conduct,
and the process for submitting pull requests to us.## ๐ Wiki
You can find more information about this project on the [wiki][wiki].
## ๐ Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available,
see the [tags on this repository][tags].## โ๏ธ Authors
- **Srealmoreno** - *Initial work* - [srealmoreno](https://github.com/srealmoreno)
See also the list of [contributors][contributors] who participated in this project.
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE.md)
file for details## ๐ Acknowledgments
- Inspiration [EndBug/label-sync](https://github.com/EndBug/label-sync)
- Templates [Z-shell](https://github.com/z-shell)