Giter Club home page Giter Club logo

label-sync's Introduction

Metrics

label-sync's People

Contributors

allcontributors[bot] avatar andrewvaughan avatar armsnyder avatar carrodher avatar danielwerg avatar dependabot[bot] avatar endbug avatar h1dden-da3m0n avatar kenodegard avatar reece avatar simbo avatar srealmoreno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

label-sync's Issues

[Q] dependabot and octokit

Hi again,
this time just a couple of questions that came up while working on #1.

  • Any particular reason this project does not use Dependabot to keep dependencies up to date?
  • Any particular reason why you dont use @actions/github over axios?

I don't feel particularly strong about either of the questions, just curious ๐Ÿ˜‰

[Q/FR] Sync labels based on a config file within another repository

Greetings there,

I am curious if it where at al passible to allow the configuration of this action to work with both source-repo and config-file to have one 'configuration repository to rule them all'?
This behaviour is already somewhat possible to realize, however it is limited to only one configuration by having this action run in one repo on a config-file to sync its labels and then any 'dependent' repos to clone those via the source-repo config.

Theoretically it should be possible to realize since GitHub's API allows for direct file access and I am interested in looking into adding this functionality to this Action if it wasn't already planed.

So the question/feature-request boils down to: have you planed/are you planing of adding this functionality, or would you accept a PR adding such?

Thank you for your work so far!

Relative `.github/` path fails

Based on the example in the README.md, the following workflow snippet:

    steps:
      - uses: EndBug/label-sync@da00f2c11fdb78e4fae44adac2fdd713778ea3e8 # v2.3.2
        with:
          # Configuration file
          config-file: .github/labels.yaml

results in the following error:

Reading config file...
  ๐Ÿ›ˆ Reading file...
  ##[debug]Resolved path: /home/runner/work/<repo-name>/<repo-name>/.github/labels.yaml
  ##[debug]Actual error: Error: ENOENT: no such file or directory, open '/home/runner/work/<repo-name>/<repo-name>/.github/labels.yaml'

[bug] Yaml Flow Scalars - Plain (multiline) not supported

When using a Flow Scalars plain the parser fails.

My labels.yml

- name: breaking-change ๐Ÿ’ฅ
  color: D93F0B
  description:
    A change that changes the API or breaks backward compatibility for
    users.

- name: bug ๐Ÿž
  color: d73a4a
  description: Inconsistencies or issues which will cause a problem for users or
    implementors.

- name: ci ๐Ÿค–
  color: "536266"
  description: Work that improves the continuous integration.

Error:

image

Apparently there is already an open issue in yamljs #112 #141 but it has not been maintained

failed to sync labeles

  1. need to add validation for more than 64 chars descriptions for labels.
    2.action failed:
Checking inputs...
  ๐Ÿ›ˆ Checking inputs...
  โœ“ Inputs are valid
Reading config file...
  ๐Ÿ›ˆ Reading file...
  ๐Ÿ›ˆ Parsing YAML file...
  โœ“ File parsed successfully.
  ๐Ÿ›ˆ Parsed config:

....
...
...

Syncing labels...
Error: โœ— Error: Validation Failed

with no indication of what and why

Allow missing and/or empty files

For a small organization, I'd like to have a common set of standardized labels and the option for some repos to add new labels. The config stanza below works well:

          config-file: |
            https://raw.githubusercontent.com/biocommons/.github/main/.github/labels.yml
            .github/labels.yml

For this to work, .github/labels.yml must exist and must not be empty. If no new labels are intended, the file may contain just [].

At a minimum, this issue may help others achieve a similar outcome.

In addition, please consider allowing a file to empty, in which case it's interpreted as [].

Handle GitHub's secondary rate limit

If a repository has too many labels (we have 190) the script hits a secondary rate limit and aborts around page 8.
The script should implement throttling to avoid that

Error: โœ— {"message":"You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID C877:3596:1DB78AD:3C701FD:6531505C.","statusCode":403,"headers":{"server":"GitHub.com","date":"Thu, 19 Oct 2023 15:50:53 GMT","content-type":"application/json; charset=utf-8","transfer-encoding":"chunked","retry-after":"1","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","access-control-allow-origin":"*","x-github-media-type":"github.v3; format=json","strict-transport-security":"max-age=31536000; includeSubdomains; preload","x-frame-options":"deny","x-content-type-options":"nosniff","x-xss-protection":"0","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","content-security-policy":"default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.githubcopilot.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events objects-origin.githubusercontent.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com support.github.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/","vary":"Accept-Encoding, Accept, X-Requested-With","x-github-request-id":"C877:3596:1DB78AD:3C701FD:6531505C","connection":"close"},"body":{"documentation_url":"https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits","message":"You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID C877:3596:1DB78AD:3C701FD:6531505C."},"method":"POST","endpoint":"/repos/redacted/redacted/labels"}

bug: Only 30 labels are synced

Tested on version 2.3.1
I tried to do a sync by specifying a source-repo to another repository which has 60 labels, the original one had 10 labels.
The action only pulled the first 30 labels and ignored the rest, as it turns out 30 is the page size in the labels page, this makes me think there's some pagination issue going on with the API that is used by the action, so it should be changed to handle pagination and grab all the tags in the source repository.

Edit: according to the documentation https://docs.github.com/en/rest/issues/labels#list-labels-for-a-repository it does seem like that the default page number is 30 and this is not handled in the script

Sync labels on another repository

There are any plans to add possibility to specify a repository or repositories as an input to the action which labels should be synchronized?

This could be really useful if you want to store your labels somewhere centrally and modify multiple repository labels via one action run.

New option target-repo or target-repos could be introduced.

What do you think about this feature?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.