Skip to content

Add format validations #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2023

Conversation

srealmoreno
Copy link
Contributor

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"

- Add validation 'Name: Must contain more than native emojis'
- Add validation 'Description: '4-byte characters are not allowed'
@srealmoreno srealmoreno requested a review from a team as a code owner June 13, 2022 21:58
@github-actions github-actions bot added the cli Relates to an Origami cli label Jun 13, 2022
Copy link
Contributor

@notlee notlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, sorry for not reviewing it sooner!

@notlee notlee added the release:patch Add to a PR to trigger a PATCH version bump when merged label Mar 8, 2023
@notlee notlee merged commit 42955c2 into Financial-Times:master Mar 8, 2023
@notlee
Copy link
Contributor

notlee commented Mar 8, 2023

That's released in 2.3.1 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Relates to an Origami cli release:patch Add to a PR to trigger a PATCH version bump when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more validations to labels name and description
2 participants