endbug / label-sync Goto Github PK
View Code? Open in Web Editor NEW:octocat: An action that allows you to sync labels from a repository or a config file
License: MIT License
:octocat: An action that allows you to sync labels from a repository or a config file
License: MIT License
Getting this error in my new repo.
https://github.com/danielwerg/r6data/actions/runs/4244636478
Not sure what changed because I'm using same exact workflow I have in r6api.js repo and it worked just fine 8 months ago (see: https://github.com/danielwerg/r6api.js/actions/runs/2579219273)
Am I missing something?
Hi again,
this time just a couple of questions that came up while working on #1.
@actions/github
over axios
?I don't feel particularly strong about either of the questions, just curious ๐
The upstream gitlab-label-sync package supports the hash-prefix when it is run as a binary, but not as a library.
Could you detect and strip the #
prefix while parsing config? It allows us to visualize colors with IDE plugins.
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!
I'd recommend adding an example as to how to use the https://github.com/actions/checkout action to load in a local file so that your users don't get a Couldn't find .... file
error`.
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'
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:
Apparently there is already an open issue in yamljs
#112 #141 but it has not been maintained
Waiting for current PRs to be merged, in order to avoid further merge conflicts.
Per https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#create-a-label
Descriptions are limited to 100-characters. Would be helpful to inform users of this in the documentation of this Action.
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
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 []
.
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"}
Having a schema would allow for autocompletion in the labels stile, either by manually linking it or by adding it to the JSON Schema Store.
I am getting Error: โ <ParseException> Unable to parse. (line 7: '<!DOCTYPE html>')
when I run the action. I am passing URL as a config-file parameter. I think the file is following the correct format because I am not getting any error when I try to convert it to JSON.
Here is the action URL https://github.com/Tech-Phantoms/Auth/runs/4158543894?check_suite_focus=true
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
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.