github-label-sync
github-label-sync copied to clipboard
Add format validations
Resolve #171
- Add validation 'Name: Must contain more than native emojis'
- Add validation 'Description: '4-byte characters are not allowed'
The regular expression to check the emojis is very long, but there is a proposal. Matching emoji sequences
labels.yml
- name: π π π π
color: "536266"
description: This is a name only contains emojis
- name: bug π
color: d73a4a
description:
This is a description that contains emojis 4-byte unicode π
Current behaviour
Syncing labels for "srealmoreno/test-label-sync"
Validating provided labels
Fetching labels from GitHub
> Missing: the "π π π π" label is missing from the repo. It will be created.
> Missing: the "bug π" label is missing from the repo. It will be created.
Applying label changes, please waitβ¦
GitHub Error:
POST /repos/srealmoreno/test-label-sync/labels
422: Validation Failed
New behaviour
Syncing labels for "srealmoreno/test-label-sync"
Validating provided labels
Invalid label:
{"name":"π π π π","color":"536266","description":"This is a name only contains emojis"}
- name must match format "must contain more than native emoji"
Invalid label:
{"name":"bug π","color":"d73a4a","description":"This is a description that contains emojis 4-byte unicode π"}
- description must match format "doesn't accept 4-byte Unicode"