[support-infra] Sync GitHub labels between repositories
Summary
We have a unified list of GitHub labels used across the organization. It's a global namespace so we can easily connect the work across different repositories. The source of truth is this notion table: 🏷️ GitHub labels.
We saw with https://github.com/mui/mui-x/issues/10810 that it can be time-consuming to sync labels between repositories. So we use https://github.com/mui/.github/labels to store any labels that is used in more than one repository, with this GitHub CLI to sync them, https://cli.github.com/manual/gh_label_clone:
But this creates problems:
- In each repository, there are many more labels than they need:
- https://github.com/mui/base-ui/pull/2615#discussion_r2318106965
- We need to manually sync https://github.com/mui/.github/labels with 🏷️ GitHub labels.
Potential solutions:
- Write a GitHub Action that runs every 24h to fetch the labels from 🏷️ GitHub labels and push the relevant one to the relevant repositories. If a label needs to be deleted, have the action fail. Requiring manual intervention (the person needs to either delete the label manually or add the label to the Notion table to be shared).
Benchmarks
- https://github.com/apache/maven-gh-actions-shared/blob/main/.github/workflows/labels-sync.yml
- https://github.com/marketplace/actions/label-sync
Search keywords: -
cc @michelengelen
GitHub CLI can be used in the interim: https://cli.github.com/manual/gh_label_clone
gh label clone owner-name/source-repo-name --repo owner-name/destination-repo-name --force
cc @michaldudak I used this to sync Base UI's labels.