├── docs └── assets │ ├── logo.png │ └── screenshot.png ├── .github ├── dependabot.yml ├── workflows │ ├── label-syncer.yml │ └── main.yml └── labels.yml ├── Dockerfile ├── go.mod ├── action.yml ├── cmd └── action-label-syncer │ └── main.go ├── go.sum ├── pkg └── github │ └── github.go ├── README.md └── LICENSE /docs/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micnncim/action-label-syncer/HEAD/docs/assets/logo.png -------------------------------------------------------------------------------- /docs/assets/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micnncim/action-label-syncer/HEAD/docs/assets/screenshot.png -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: gomod 4 | directory: "/" 5 | schedule: 6 | interval: weekly 7 | time: "20:00" 8 | open-pull-requests-limit: 10 9 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.13 AS build 2 | 3 | WORKDIR /go/src/app 4 | COPY . /go/src/app 5 | RUN go get -d -v ./... 6 | RUN go build -o /go/bin/app cmd/action-label-syncer/main.go 7 | 8 | FROM gcr.io/distroless/base 9 | COPY --from=build /go/bin/app / 10 | CMD ["/app"] 11 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/micnncim/action-label-syncer 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/google/go-github v17.0.0+incompatible 7 | github.com/google/go-querystring v1.0.0 // indirect 8 | go.uber.org/multierr v1.7.0 9 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 10 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e 11 | gopkg.in/yaml.v2 v2.4.0 12 | ) 13 | -------------------------------------------------------------------------------- /.github/workflows/label-syncer.yml: -------------------------------------------------------------------------------- 1 | name: Sync labels 2 | 3 | on: 4 | push: 5 | paths: 6 | - '.github/labels.yml' 7 | branches: 8 | - master 9 | jobs: 10 | build: 11 | name: Sync labels 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@1.0.0 15 | - uses: micnncim/action-label-syncer@v0.3.1 16 | env: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | -------------------------------------------------------------------------------- /.github/labels.yml: -------------------------------------------------------------------------------- 1 | - color: d73a4a 2 | description: Something isn't working 3 | name: bug 4 | - color: 0075ca 5 | description: Improvements or additions to documentation 6 | name: documentation 7 | - color: cfd3d7 8 | description: This issue or pull request already exists 9 | name: duplicate 10 | - color: a2eeef 11 | description: New feature or request 12 | name: enhancement 13 | - color: "008672" 14 | description: Extra attention is needed 15 | name: help wanted 16 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: [push] 3 | jobs: 4 | test: 5 | name: Test 6 | runs-on: ubuntu-latest 7 | steps: 8 | - name: Set up Go 1.13 9 | uses: actions/setup-go@v1 10 | with: 11 | go-version: 1.13 12 | id: go 13 | - name: Check out code into the Go module directory 14 | uses: actions/checkout@v1 15 | - name: Download modules 16 | run: go get -d -v ./... 17 | - name: Test 18 | run: go test ./... 19 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Label Syncer" 2 | description: "Sync GitHub labels in the declarative way." 3 | author: "micnncim" 4 | inputs: 5 | manifest: 6 | description: "File path of YAML manifest for labels" 7 | required: false 8 | default: ".github/labels.yml" 9 | repository: 10 | description: "The repo to sync labels on (defaults to current repo)" 11 | required: false 12 | token: 13 | description: "An alternative GitHub token to use instead" 14 | required: false 15 | prune: 16 | description: "Remove unmanaged labels from repository" 17 | required: false 18 | default: true 19 | runs: 20 | using: "docker" 21 | image: "Dockerfile" 22 | branding: 23 | icon: circle 24 | color: black 25 | -------------------------------------------------------------------------------- /cmd/action-label-syncer/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 micnncim 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package main 16 | 17 | import ( 18 | "context" 19 | "fmt" 20 | "log" 21 | "os" 22 | "strconv" 23 | "strings" 24 | 25 | "github.com/micnncim/action-label-syncer/pkg/github" 26 | "go.uber.org/multierr" 27 | ) 28 | 29 | func main() { 30 | if err := run(context.Background()); err != nil { 31 | log.Fatal(err) 32 | } 33 | } 34 | 35 | func run(ctx context.Context) error { 36 | manifest := os.Getenv("INPUT_MANIFEST") 37 | labels, err := github.FromManifestToLabels(manifest) 38 | if err != nil { 39 | return fmt.Errorf("unable to load manifest: %w", err) 40 | } 41 | 42 | prune, err := strconv.ParseBool(os.Getenv("INPUT_PRUNE")) 43 | if err != nil { 44 | return fmt.Errorf("unable to parse prune: %w", err) 45 | } 46 | 47 | token := os.Getenv("INPUT_TOKEN") 48 | if len(token) == 0 { 49 | token = os.Getenv("GITHUB_TOKEN") 50 | } 51 | client := github.NewClient(token) 52 | 53 | repository := os.Getenv("INPUT_REPOSITORY") 54 | if len(repository) == 0 { 55 | repository = os.Getenv("GITHUB_REPOSITORY") 56 | } 57 | 58 | // Doesn't run concurrently to avoid GitHub API rate limit. 59 | for _, r := range strings.Split(repository, "\n") { 60 | if len(r) == 0 { 61 | continue 62 | } 63 | 64 | s := strings.Split(r, "/") 65 | if len(s) != 2 { 66 | err = multierr.Append(err, fmt.Errorf("invalid repository: %s", repository)) 67 | } 68 | owner, repo := s[0], s[1] 69 | 70 | if err := client.SyncLabels(ctx, owner, repo, labels, prune); err != nil { 71 | err = multierr.Append(err, fmt.Errorf("unable to sync labels: %w", err)) 72 | } 73 | } 74 | 75 | return err 76 | } 77 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 3 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 4 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 5 | github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= 6 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 7 | github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= 8 | github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= 9 | github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= 10 | github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= 11 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 12 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 13 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 14 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 15 | github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= 16 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 17 | go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= 18 | go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= 19 | go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= 20 | go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= 21 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 22 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= 23 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 24 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= 25 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 26 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 27 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= 28 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 29 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 30 | google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= 31 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 32 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 33 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 34 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 35 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 36 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 37 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= 38 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 39 | -------------------------------------------------------------------------------- /pkg/github/github.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 micnncim 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package github 16 | 17 | import ( 18 | "context" 19 | "fmt" 20 | "io/ioutil" 21 | 22 | "github.com/google/go-github/github" 23 | "golang.org/x/oauth2" 24 | "golang.org/x/sync/errgroup" 25 | "gopkg.in/yaml.v2" 26 | ) 27 | 28 | type Client struct { 29 | githubClient *github.Client 30 | token string 31 | } 32 | 33 | type Label struct { 34 | Name string `yaml:"name"` 35 | Description string `yaml:"description"` 36 | Color string `yaml:"color"` 37 | } 38 | 39 | func FromManifestToLabels(path string) ([]Label, error) { 40 | buf, err := ioutil.ReadFile(path) 41 | if err != nil { 42 | return nil, err 43 | } 44 | var labels []Label 45 | err = yaml.Unmarshal(buf, &labels) 46 | return labels, err 47 | } 48 | 49 | func NewClient(token string) *Client { 50 | ctx := context.Background() 51 | ts := oauth2.StaticTokenSource( 52 | &oauth2.Token{AccessToken: token}, 53 | ) 54 | tc := oauth2.NewClient(ctx, ts) 55 | return &Client{ 56 | githubClient: github.NewClient(tc), 57 | } 58 | } 59 | 60 | func (c *Client) SyncLabels(ctx context.Context, owner, repo string, labels []Label, prune bool) error { 61 | labelMap := make(map[string]Label) 62 | for _, l := range labels { 63 | labelMap[l.Name] = l 64 | } 65 | 66 | currentLabels, err := c.getLabels(ctx, owner, repo) 67 | if err != nil { 68 | return err 69 | } 70 | currentLabelMap := make(map[string]Label) 71 | for _, l := range currentLabels { 72 | currentLabelMap[l.Name] = l 73 | } 74 | 75 | eg := errgroup.Group{} 76 | 77 | // Delete labels. 78 | if prune { 79 | for _, currentLabel := range currentLabels { 80 | currentLabel := currentLabel 81 | eg.Go(func() error { 82 | _, ok := labelMap[currentLabel.Name] 83 | if ok { 84 | return nil 85 | } 86 | return c.deleteLabel(ctx, owner, repo, currentLabel.Name) 87 | }) 88 | } 89 | 90 | if err := eg.Wait(); err != nil { 91 | return err 92 | } 93 | } 94 | 95 | // Create and/or update labels. 96 | for _, l := range labels { 97 | l := l 98 | eg.Go(func() error { 99 | currentLabel, ok := currentLabelMap[l.Name] 100 | if !ok { 101 | return c.createLabel(ctx, owner, repo, l) 102 | } 103 | if currentLabel.Description != l.Description || currentLabel.Color != l.Color { 104 | return c.updateLabel(ctx, owner, repo, l) 105 | } 106 | fmt.Printf("label: %+v not changed on %s/%s\n", l, owner, repo) 107 | return nil 108 | }) 109 | } 110 | 111 | return eg.Wait() 112 | } 113 | 114 | func (c *Client) createLabel(ctx context.Context, owner, repo string, label Label) error { 115 | l := &github.Label{ 116 | Name: &label.Name, 117 | Description: &label.Description, 118 | Color: &label.Color, 119 | } 120 | _, _, err := c.githubClient.Issues.CreateLabel(ctx, owner, repo, l) 121 | fmt.Printf("label: %+v created on: %s/%s\n", label, owner, repo) 122 | return err 123 | } 124 | 125 | func (c *Client) getLabels(ctx context.Context, owner, repo string) ([]Label, error) { 126 | opt := &github.ListOptions{ 127 | PerPage: 50, 128 | } 129 | var labels []Label 130 | for { 131 | ls, resp, err := c.githubClient.Issues.ListLabels(ctx, owner, repo, opt) 132 | if err != nil { 133 | return nil, err 134 | } 135 | for _, l := range ls { 136 | labels = append(labels, Label{ 137 | Name: l.GetName(), 138 | Description: l.GetDescription(), 139 | Color: l.GetColor(), 140 | }) 141 | } 142 | if resp.NextPage == 0 { 143 | break 144 | } 145 | opt.Page = resp.NextPage 146 | } 147 | return labels, nil 148 | } 149 | 150 | func (c *Client) updateLabel(ctx context.Context, owner, repo string, label Label) error { 151 | l := &github.Label{ 152 | Name: &label.Name, 153 | Description: &label.Description, 154 | Color: &label.Color, 155 | } 156 | _, _, err := c.githubClient.Issues.EditLabel(ctx, owner, repo, label.Name, l) 157 | fmt.Printf("label %+v updated on: %s/%s\n", label, owner, repo) 158 | return err 159 | } 160 | 161 | func (c *Client) deleteLabel(ctx context.Context, owner, repo, name string) error { 162 | _, err := c.githubClient.Issues.DeleteLabel(ctx, owner, repo, name) 163 | fmt.Printf("label: %s deleted from: %s/%s\n", name, owner, repo) 164 | return err 165 | } 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](docs/assets/logo.png) 2 | 3 | [![actions-workflow-test][actions-workflow-test-badge]][actions-workflow-test] 4 | [![actions-marketplace][actions-marketplace-badge]][actions-marketplace] 5 | [![release][release-badge]][release] 6 | [![pkg.go.dev][pkg.go.dev-badge]][pkg.go.dev] 7 | [![dependabot][dependabot-badge]][dependabot] 8 | [![license][license-badge]][license] 9 | 10 | GitHub Actions workflow to sync GitHub labels in the declarative way. 11 | 12 | By using this workflow, you can sync current labels with labels configured in a YAML manifest. 13 | 14 | ## Usage 15 | 16 | ### Create YAML manifest of GitHub labels 17 | 18 | ```yaml 19 | - name: bug 20 | description: Something isn't working 21 | color: d73a4a 22 | - name: documentation 23 | description: Improvements or additions to documentation 24 | color: 0075ca 25 | - name: duplicate 26 | description: This issue or pull request already exists 27 | color: cfd3d7 28 | ``` 29 | 30 | ![](docs/assets/screenshot.png) 31 | 32 | The default file path is `.github/labels.yml`, but you can specify any file path with `jobs..steps.with.manifest`. 33 | 34 | To create manifest of the current labels easily, using [label-exporter](https://github.com/micnncim/label-exporter) is recommended. 35 | 36 | ### Create Workflow 37 | 38 | An example workflow is here. 39 | 40 | ```yaml 41 | name: Sync labels 42 | on: 43 | push: 44 | branches: 45 | - master 46 | paths: 47 | - path/to/manifest/labels.yml 48 | jobs: 49 | build: 50 | runs-on: ubuntu-latest 51 | steps: 52 | - uses: actions/checkout@v2 53 | - uses: micnncim/action-label-syncer@v1 54 | env: 55 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 56 | with: 57 | manifest: path/to/manifest/labels.yml 58 | ``` 59 | 60 | If a label color or description changes, the same label is updated with the new color or description. If a label name changes, the previous label is deleted by default. 61 | Also all existing labels which not listed in `manifest` will be deleted by default. 62 | All issues and PRs that were previously labeled with this label are now unlabeled. 63 | 64 | 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. 65 | 66 | ## Sync labels on another repository 67 | 68 | It is also possible to specify a repository or repositories as an input to the action. This is useful if you want to store your labels somewhere centrally and modify multiple repository labels. 69 | 70 | **Note: The default `GITHUB_TOKEN` will not have permissions to operate on other repositories so you must specify a personal access token in your secrets.** 71 | 72 | ```yaml 73 | name: Sync labels 74 | on: 75 | push: 76 | branches: 77 | - master 78 | paths: 79 | - path/to/manifest/labels.yml 80 | jobs: 81 | build: 82 | runs-on: ubuntu-latest 83 | steps: 84 | - uses: actions/checkout@v2 85 | - uses: micnncim/action-label-syncer@v1 86 | with: 87 | manifest: path/to/manifest/labels.yml 88 | repository: | 89 | owner/repository-1 90 | owner/repository-2 91 | token: ${{ secrets.PERSONAL_TOKEN }} 92 | ``` 93 | 94 | ## Project using action-label-syncer 95 | 96 | - [cloudalchemy/ansible-prometheus](https://github.com/cloudalchemy/ansible-prometheus) 97 | - [cloudalchemy/ansible-grafana](https://github.com/cloudalchemy/ansible-grafana) 98 | - [cloudalchemy/ansible-node-exporter](https://github.com/cloudalchemy/ansible-node-exporter) 99 | - [cloudalchemy/ansible-fluentd](https://github.com/cloudalchemy/ansible-fluentd) 100 | - [cloudalchemy/ansible-alertmanager](https://github.com/cloudalchemy/ansible-alertmanager) 101 | - [cloudalchemy/ansible-blackbox-exporter](https://github.com/cloudalchemy/ansible-blackbox-exporter) 102 | - [cloudalchemy/ansible-pushgateway](https://github.com/cloudalchemy/ansible-pushgateway) 103 | - [cloudalchemy/ansible-coredns](https://github.com/cloudalchemy/ansible-coredns) 104 | - [sagebind/isahc](https://github.com/sagebind/isahc) 105 | - [JulienBreux/baleia](https://github.com/JulienBreux/baleia) 106 | - [Simplify4U](https://github.com/s4u) 107 | - [Poeschl's Home Assistant Addons](https://github.com/Poeschl/Hassio-Addons) 108 | - [The Guild - Master Labels](https://github.com/the-guild-org/shared-resources) 109 | - [The Guild - GraphQL Codegen](https://github.com/dotansimha/graphql-code-generator) 110 | - [The Guild - GraphQL ESLint](https://github.com/dotansimha/graphql-eslint) 111 | - [The Guild - Apollo Angular](https://github.com/kamilkisiela/apollo-angular) 112 | - [The Guild - GraphQL Config](https://github.com/kamilkisiela/graphql-config) 113 | - [The Guild - GraphQL Mesh](https://github.com/Urigo/graphql-mesh) 114 | - [The Guild - GraphQL Modules](https://github.com/Urigo/graphql-modules) 115 | - [The Guild - GraphQL Inspector](https://github.com/kamilkisiela/graphql-inspector) 116 | - [The Guild - GraphQL Tools](https://github.com/ardatan/graphql-tools) 117 | - [The Guild - GraphQL Scalars](https://github.com/Urigo/graphql-scalars) 118 | - [The Guild - Whatsapp Clone](https://github.com/Urigo/WhatsApp-Clone-Tutorial) 119 | - [The Guild - GraphQL CLI](https://github.com/Urigo/graphql-cli) 120 | - [The Guild - SOFA](https://github.com/Urigo/SOFA) 121 | 122 | If you're using `action-label-syncer` in your project, please send a PR to list your project! 123 | 124 | ## See also 125 | 126 | - [Prow](https://github.com/kubernetes/test-infra/tree/master/prow) 127 | - [actions/labeler](https://github.com/actions/labeler) 128 | - [lannonbr/issue-label-manager-action](https://github.com/lannonbr/issue-label-manager-action) 129 | - [b4b4r07/github-labeler](https://github.com/b4b4r07/github-labeler) 130 | 131 | ## Note 132 | 133 | _Icon made by bqlqn from [www.flaticon.com](https://www.flaticon.com)_ 134 | 135 | 136 | 137 | [actions-workflow-test]: https://github.com/micnncim/action-label-syncer/actions?query=workflow%3ACI 138 | [actions-workflow-test-badge]: https://img.shields.io/github/workflow/status/micnncim/action-label-syncer/CI?label=CI&style=for-the-badge&logo=github 139 | [actions-marketplace]: https://github.com/marketplace/actions/label-syncer 140 | [actions-marketplace-badge]: https://img.shields.io/badge/marketplace-label%20syncer-blue?style=for-the-badge&logo=github 141 | [release]: https://github.com/micnncim/action-label-syncer/releases 142 | [release-badge]: https://img.shields.io/github/v/release/micnncim/action-label-syncer?style=for-the-badge&logo=github 143 | [pkg.go.dev]: https://pkg.go.dev/github.com/micnncim/action-label-syncer?tab=overview 144 | [pkg.go.dev-badge]: https://img.shields.io/badge/pkg.go.dev-reference-02ABD7?style=for-the-badge&logoWidth=25&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ijg1IDU1IDEyMCAxMjAiPjxwYXRoIGZpbGw9IiMwMEFERDgiIGQ9Ik00MC4yIDEwMS4xYy0uNCAwLS41LS4yLS4zLS41bDIuMS0yLjdjLjItLjMuNy0uNSAxLjEtLjVoMzUuN2MuNCAwIC41LjMuMy42bC0xLjcgMi42Yy0uMi4zLS43LjYtMSAuNmwtMzYuMi0uMXptLTE1LjEgOS4yYy0uNCAwLS41LS4yLS4zLS41bDIuMS0yLjdjLjItLjMuNy0uNSAxLjEtLjVoNDUuNmMuNCAwIC42LjMuNS42bC0uOCAyLjRjLS4xLjQtLjUuNi0uOS42bC00Ny4zLjF6bTI0LjIgOS4yYy0uNCAwLS41LS4zLS4zLS42bDEuNC0yLjVjLjItLjMuNi0uNiAxLS42aDIwYy40IDAgLjYuMy42LjdsLS4yIDIuNGMwIC40LS40LjctLjcuN2wtMjEuOC0uMXptMTAzLjgtMjAuMmMtNi4zIDEuNi0xMC42IDIuOC0xNi44IDQuNC0xLjUuNC0xLjYuNS0yLjktMS0xLjUtMS43LTIuNi0yLjgtNC43LTMuOC02LjMtMy4xLTEyLjQtMi4yLTE4LjEgMS41LTYuOCA0LjQtMTAuMyAxMC45LTEwLjIgMTkgLjEgOCA1LjYgMTQuNiAxMy41IDE1LjcgNi44LjkgMTIuNS0xLjUgMTctNi42LjktMS4xIDEuNy0yLjMgMi43LTMuN2gtMTkuM2MtMi4xIDAtMi42LTEuMy0xLjktMyAxLjMtMy4xIDMuNy04LjMgNS4xLTEwLjkuMy0uNiAxLTEuNiAyLjUtMS42aDM2LjRjLS4yIDIuNy0uMiA1LjQtLjYgOC4xLTEuMSA3LjItMy44IDEzLjgtOC4yIDE5LjYtNy4yIDkuNS0xNi42IDE1LjQtMjguNSAxNy05LjggMS4zLTE4LjktLjYtMjYuOS02LjYtNy40LTUuNi0xMS42LTEzLTEyLjctMjIuMi0xLjMtMTAuOSAxLjktMjAuNyA4LjUtMjkuMyA3LjEtOS4zIDE2LjUtMTUuMiAyOC0xNy4zIDkuNC0xLjcgMTguNC0uNiAyNi41IDQuOSA1LjMgMy41IDkuMSA4LjMgMTEuNiAxNC4xLjYuOS4yIDEuNC0xIDEuN3oiLz48cGF0aCBmaWxsPSIjMDBBREQ4IiBkPSJNMTg2LjIgMTU0LjZjLTkuMS0uMi0xNy40LTIuOC0yNC40LTguOC01LjktNS4xLTkuNi0xMS42LTEwLjgtMTkuMy0xLjgtMTEuMyAxLjMtMjEuMyA4LjEtMzAuMiA3LjMtOS42IDE2LjEtMTQuNiAyOC0xNi43IDEwLjItMS44IDE5LjgtLjggMjguNSA1LjEgNy45IDUuNCAxMi44IDEyLjcgMTQuMSAyMi4zIDEuNyAxMy41LTIuMiAyNC41LTExLjUgMzMuOS02LjYgNi43LTE0LjcgMTAuOS0yNCAxMi44LTIuNy41LTUuNC42LTggLjl6bTIzLjgtNDAuNGMtLjEtMS4zLS4xLTIuMy0uMy0zLjMtMS44LTkuOS0xMC45LTE1LjUtMjAuNC0xMy4zLTkuMyAyLjEtMTUuMyA4LTE3LjUgMTcuNC0xLjggNy44IDIgMTUuNyA5LjIgMTguOSA1LjUgMi40IDExIDIuMSAxNi4zLS42IDcuOS00LjEgMTIuMi0xMC41IDEyLjctMTkuMXoiLz48L3N2Zz4= 145 | [dependabot]: https://github.com/micnncim/action-label-syncer/pulls?q=is:pr%20author:app/dependabot-preview 146 | [dependabot-badge]: https://img.shields.io/badge/dependabot-enabled-blue?style=for-the-badge&logo=dependabot 147 | [license]: LICENSE 148 | [license-badge]: https://img.shields.io/github/license/micnncim/action-label-syncer?style=for-the-badge 149 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2020 micnncim 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | --------------------------------------------------------------------------------