https://github.com/kubecub/github-label-syncer

An cross-repository syncing and pull loacl saved GitHub tags CLI or actions tool.

https://github.com/kubecub/github-label-syncer

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

actions cicd github github-actions go golang labels robot

Keywords from Contributors

learning makefile archival interactive projection kubecub profiles sequences generic ecosystem-modeling
Last synced: 4 months ago · JSON representation

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
actions cicd github github-actions go golang labels robot
Created almost 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog Contributing Funding License Codeowners

README.md

github-label-syncer

⭐️ sync labels between repos and org. ⭐️

A+ good first

English中文


🧩 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, table AND json
  • [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: Owner of the repository. Repository whose wanted labels.

❯ 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..steps.with.prune: false in order to preserver all existing labels which is not mentioned in manifest, in this case when a label will be renamed old label will be not deleted.

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.

FOSSA Status

🔮 Thanks to our contributors!

Owner

  • Name: Kubernetes Cub community
  • Login: kubecub
  • Kind: organization
  • Email: cub@nsddd.top
  • Location: China

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

All Time
  • Total Commits: 182
  • Total Committers: 7
  • Avg Commits per committer: 26.0
  • Development Distribution Score (DDS): 0.291
Past Year
  • Commits: 11
  • Committers: 4
  • Avg Commits per committer: 2.75
  • Development Distribution Score (DDS): 0.545
Top Committers
Name Email 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)
qq.com: 1

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
lifecycle/stale (84) kind/documentation (71) triage/unresolved (71) report (40) triage/accepted (10) good first issue (3) help wanted (1)
Pull Request Labels
lifecycle/stale (105) size/S (52) size/XS (34) sweep (16) size/M (15) dependencies (13) size/L (9) size/XXL (4) size/XL (1)

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
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 8.9%
Dependent repos count: 10.6%
Average: 13.8%
Stargazers count: 16.6%
Forks count: 19.1%
Last synced: 5 months ago