https://github.com/kubecub/github-label-syncer
An cross-repository syncing and pull loacl saved GitHub tags CLI or actions tool.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
An cross-repository syncing and pull loacl saved GitHub tags CLI or actions tool.
Basic Info
- Host: GitHub
- Owner: kubecub
- License: mit
- Language: Shell
- Default Branch: main
- Size: 927 KB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
github-label-syncer
⭐️ sync labels between repos and org. ⭐️
🧩 Awesome features
This document discusses the development of a Go language actions that synchronizes labels on GitHub repositories. This actions is not limited to synchronizing labels on your own repository, but can also retrieve all of the API objects of a target repository, which can then be saved to a YAML file or synchronized to your own GitHub project.
Labels are an important way of organizing and categorizing issues and pull requests on GitHub. They allow you to quickly and easily identify the status, priority, and type of each issue or pull request.
To retrieve the API objects of a GitHub project's labels, you can use the following URLs:
- To retrieve the first page of objects:
https://api.github.com/repos/<owner>/<repo>/labels?page=1&sort=name-asc - To retrieve all objects:
https://api.github.com/repos/<owner>/<repo>/labels?per_page=100&page=1&sort=name-asc
Simply replace <owner> and <repo> with the owner and repository name, respectively. These URLs can be used to retrieve all of the labels associated with a project, which can then be synchronized or saved as needed.
github-label-syncer is a tool to sync labels between repos and org. The main features are:
- [x] Feel free to pick a remote repository and fetch all its labels to a local
yaml,tableANDjson - [x] Feel free to pick a remote repository and sync all of its labels to your desired project repository
- [x] Sync labels across repositories according to configuration
- [x] Create, update and delete labels
- [x] Dry run to preview which labels would be created, updated or deleted
- [x] Handle label collisions by renaming or skipping existing labels
- [x] Support labeling pull requests and issues
Labels denger: The labels are designed semantic and standard. We provide labels for priority, type, status etc. You can refer to the label doc to get more info.
**github actions
🛫 Quick start
Note: You can get started quickly with github-label-syncer.
📦 Installation
bash
git clone https://github.com/kubecub/github-label-syncer/release syncer && export syncer=$(pwd)/syncer && cd $syncer && make
Install from github release
Install from GitHub Releases
Work with Makefile
bash
❯ make help # show help
❯ make build # build binary exporter and syncer
❯ echo 'export PATH=$PATH:/path/to/_output/platforms/linux/amd64/' | tee -a ~/.zshrc;source ~/.zshrc
Use Github-Label-Syncer
You can set your own GITHUB_TOKEN via env or via the export GITHUB_TOKEN environment variable, or use one of the default tokens we provide, which is TOEKN for our free automated 🤖 robot
```bash
❯ ./_output/bin/platforms/linux/amd64/exporter --help
usage: exporter [
Flags: --[no-]help Show context-sensitive help (also try --help-long and --help-man). -y, --[no-]yaml Use the YAML format. -j, --[no-]json Use the JSON format. -t, --[no-]table Use the table format. -x, --[no-]xml Use the XML format. --[no-]toml Use the TOML format. --[no-]ini Use the INI format. --[no-]csv Use the CSV format. -f, --file=FILE Export labels to file. --token=TOKEN GitHub token. ($GITHUB_TOKEN)
Args:
❯ export GITHUBTOKEN="ghp****************************************0z" ❯ exporter kubecub log --json | jq [ { "name": "major version", "description": "Automatically create a new major version tag after PR is merged", "color": "1E8DE7" }, { "name": "merge when passing", "description": "Merge the PR automatically once all status checks have passed", "color": "FF851B" }, { "name": "minor version", "description": "Automatically create a new minor version tag after PR is merged", "color": "6EBAF7" }, { "name": "patch version", "description": "Automatically create a new patch version tag after PR is merged", "color": "99cef9" } ]
❯ ./output/bin/platforms/linux/amd64/exporter kubernetes kubernetes --yaml -f ./output/tmp/kuberneteslabels.yaml ❯ tree _output/ root@kubecub# tree _output/ _output/ ├── bin │ └── platforms │ └── linux │ └── amd64 │ ├── exporter │ ├── merged-binary │ └── syncer ├── tmp │ └── kuberneteslabels.yaml └── tools ├── addlicense ├── git-chglog ├── github-release ├── go-gitlint └── gsemver
❯ ./syncer --help ```
labels template
```bash
kubernetes
❯ ./output/bin/platforms/linux/amd64/exporter kubernetes kubernetes --yaml -f ./labels-templates/kubernetes-yaml.yaml ❯ ./output/bin/platforms/linux/amd64/exporter kubernetes kubernetes --table -f ./labels-templates/kubernetes-table.txt ❯ ./output/bin/platforms/linux/amd64/exporter kubernetes kubernetes --json -f ./labels-templates/kubernetes-json.json ❯ ./output/bin/platforms/linux/amd64/exporter kubernetes kubernetes --xml -f ./labels-templates/kubernetes-xml.xml
openim OpenIMSDK/Open-IM-Server
❯ ./output/bin/platforms/linux/amd64/exporter OpenIMSDK Open-IM-Server --yaml -f ./labels-templates/openim-yaml.yaml ❯ ./output/bin/platforms/linux/amd64/exporter OpenIMSDK Open-IM-Server --table -f ./labels-templates/openim-table.txt ❯ ./output/bin/platforms/linux/amd64/exporter OpenIMSDK Open-IM-Server --json -f ./labels-templates/openim-json.json ❯ ./output/bin/platforms/linux/amd64/exporter OpenIMSDK Open-IM-Server --xml -f ./labels-templates/openim-xml.xml
sealos labring/sealos
❯ ./output/bin/platforms/linux/amd64/exporter labring sealos --yaml -f ./labels-templates/sealos-yaml.yaml ❯ ./output/bin/platforms/linux/amd64/exporter labring sealos --table -f ./labels-templates/sealos-table.txt ❯ ./output/bin/platforms/linux/amd64/exporter labring sealos --json -f ./labels-templates/sealos-json.json ❯ ./output/bin/platforms/linux/amd64/exporter labring sealos --xml -f ./labels-templates/sealos-xml.xml
vscode microsoft/vscode
❯ ./output/bin/platforms/linux/amd64/exporter microsoft vscode --yaml -f ./labels-templates/vscode-yaml.yaml ❯ ./output/bin/platforms/linux/amd64/exporter microsoft vscode --table -f ./labels-templates/vscode-table.txt ❯ ./output/bin/platforms/linux/amd64/exporter microsoft vscode --json -f ./labels-templates/vscode-json.json ❯ ./output/bin/platforms/linux/amd64/exporter microsoft vscode --xml -f ./labels-templates/vscode-xml.xml
kubernetes-sigs kustomize
❯ ./output/bin/platforms/linux/amd64/exporter kubernetes-sigs kustomize --yaml -f ./labels-templates/kustomize-yaml.yaml ❯ ./output/bin/platforms/linux/amd64/exporter kubernetes-sigs kustomize --table -f ./labels-templates/kustomize-table.txt ❯ ./output/bin/platforms/linux/amd64/exporter kubernetes-sigs kustomize --json -f ./labels-templates/kustomize-json.json ❯ ./output/bin/platforms/linux/amd64/exporter kubernetes-sigs kustomize --xml -f ./labels-templates/kustomize-xml.xml
prometheus prometheus
❯ ./output/bin/platforms/linux/amd64/exporter prometheus prometheus --yaml -f ./labels-templates/prometheus-yaml.yaml ❯ ./output/bin/platforms/linux/amd64/exporter prometheus prometheus --table -f ./labels-templates/prometheus-table.txt ❯ ./output/bin/platforms/linux/amd64/exporter prometheus prometheus --json -f ./labels-templates/prometheus-json.json ❯ ./output/bin/platforms/linux/amd64/exporter prometheus prometheus --xml -f ./labels-templates/prometheus-xml.xml
prow kubernetes/test-infra
❯ ./output/bin/platforms/linux/amd64/exporter kubernetes test-infra --yaml -f ./labels-templates/test-infra-yaml.yaml ❯ ./output/bin/platforms/linux/amd64/exporter kubernetes test-infra --table -f ./labels-templates/test-infra-table.txt ❯ ./output/bin/platforms/linux/amd64/exporter kubernetes test-infra --json -f ./labels-templates/test-infra-json.json ❯ ./output/bin/platforms/linux/amd64/exporter kubernetes test-infra --xml -f ./labels-templates/test-infra-xml.xml
redis redis
❯ ./output/bin/platforms/linux/amd64/exporter redis redis --yaml -f ./labels-templates/redis-yaml.yaml ❯ ./output/bin/platforms/linux/amd64/exporter redis redis --table -f ./labels-templates/redis-table.txt ❯ ./_output/bin/platforms/linux/amd64/exporter redis redis --json -f ./labels-templates/redis-json.json ```
Actions Auto Sync labels
For a more convenient way, we can use actions to sync labels directly, which is faster and easier
An example workflow is here:
yaml
name: Sync labels
on:
push:
branches:
- master
paths:
- path/to/manifest/labels.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Github lables pull and synchronize
uses: kubecub/github-label-syncer@v2.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
manifest: path/to/manifest/labels.yml
You can sync labels to multiple repositories at the same time, which is more convenient, but you'll need to provide a token.
For example, the following yaml file takes a local.github/sync_labeler.yml file and syncs it to kubecub/github-label-syncer, kubecub/log, etc. BOT_GITHUB_TOKEN is used as the token
```yaml name: Kubecub Sync labels
on: push: branches: - main # paths: # - .github/sync_labels.yml
jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@1.0.0 - name: Github lables pull and synchronize uses: kubecub/github-label-syncer@v2.0.0 with: manifest: .github/synclabeler.yml token: ${{ secrets.BOTGITHUBTOKEN }} repository: | kubecub/github-label-syncer kubecub/log env: GITHUBTOKEN: ${{ secrets.BOTGITHUBTOKEN }} ```
Note: The new labels and colors will replace the old ones
You can add jobs.
Work with Docker
bash
❯ make deploy
🕋 architecture diagram
mermaid
graph LR
A[Config file] -->B(github-label-syncer)
B --> C{Sync labels}
C -->|Yes| D[Create/Update labels]
C -->|No | E[Delete labels]
D --> F[Dry run]
F --> |Yes| G[Preview]
F --> |No| H[Apply changes]
E --> I[Dry run]
I --> |Yes| J[Preview]
I --> |No| K[Apply changes]
MVC Architecture Design: ```mermaid flowchart TB
A[Config file]
A --> B[github-label-syncer]
B --> C{Sync labels}
C -->|Yes|D[Create/Update
labels]
C -->|No|E[Delete
labels]
D -.-> F[Dry run
Preview]
F --> G[Apply
changes]
E -.-> H[Dry run
Preview]
H --> I[Apply
changes]
B --> J[Label
PRs &
Issues]
```
🗓️ community meeting
We welcome everyone to join us and contribute to github-label-syncer, whether you are new to open source or professional. We are committed to promoting an open source culture, so we offer community members neighborhood prizes and reward money in recognition of their contributions. We believe that by working together, we can build a strong community and make valuable open source tools and resources available to more people. So if you are interested in github-label-syncer, please join our community and start contributing your ideas and skills!
We take notes of each biweekly meeting in GitHub discussions, and our minutes are written in Google Docs.
github-label-syncer maintains a public roadmap. It gives a a high-level view of the main priorities for the project, the maturity of different features and projects, and how to influence the project direction.
🤼 Contributing & Development
kubecub Our goal is to build a top-level open source community. We have a set of standards, in the Community repository.
If you'd like to contribute to this github-label-syncer repository, please read our contributor documentation.
Before you start, please make sure your changes are in demand. The best for that is to create a new discussion OR Slack Communication, or if you find an issue, report it first.
🚨 License
Kubecub is licensed under the MIT License, Version 2.0. See LICENSE for the full license text.
🔮 Thanks to our contributors!
Owner
- Name: Kubernetes Cub community
- Login: kubecub
- Kind: organization
- Email: cub@nsddd.top
- Location: China
- Website: nsddd.top
- Twitter: xxw3293172751
- Repositories: 1
- Profile: https://github.com/kubecub
c-ub is a learning community for all, where you can find blockchain, operating systems, cloud-native projects, and a wide variety of resources and notebooks
GitHub Events
Total
- Pull request event: 1
- Create event: 1
Last Year
- Pull request event: 1
- Create event: 1
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Xinwei Xiong(cubxxw-openim) | 3****s@g****m | 129 |
| Xinwei Xiong | 8****w | 30 |
| kubbot | 3****y@g****m | 13 |
| sweep-ai[bot] | 1****] | 5 |
| Xinwei Xiong | 3****1@q****m | 3 |
| I am a robot (AI & Auto) | 1****t | 1 |
| dependabot[bot] | 4****] | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 106
- Total pull requests: 74
- Average time to close issues: 23 days
- Average time to close pull requests: 27 days
- Total issue authors: 1
- Total pull request authors: 3
- Average comments per issue: 2.96
- Average comments per pull request: 12.08
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 69
Past Year
- Issues: 11
- Pull requests: 66
- Average time to close issues: 27 days
- Average time to close pull requests: 29 days
- Issue authors: 1
- Pull request authors: 3
- Average comments per issue: 2.0
- Average comments per pull request: 13.18
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 65
Top Authors
Issue Authors
- kubbot (96)
Pull Request Authors
- sweep-ai[bot] (102)
- dependabot[bot] (13)
- cubxxw (6)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 8
proxy.golang.org: github.com/kubecub/github-label-syncer
- Homepage: https://github.com/kubecub/github-label-syncer
- Documentation: https://pkg.go.dev/github.com/kubecub/github-label-syncer#section-documentation
- License: MIT
-
Latest release: v1.4.0
published over 2 years ago