Skip to content

git URLs with capitalized letters (e.g. GitHub repos) not processed by the script #68

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

Closed
SeanKilleen opened this issue Mar 17, 2021 · 2 comments

Comments

@SeanKilleen
Copy link
Contributor

The below regex does not allow capital letters:

const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/);

This, combined with no console output, can leave the script only performing part of its functionality which may leave some users confused.

I see a few potential remedies here but I'm less familiar with the tool, so wanted to get some input.

It seems we could:

  • Adjust the regex to allow capital letters
  • Call ToLower() on the key prior to processing it in the regex
  • Be explicit about keys not matching and ensuring that we publish a message stating why.

I'll submit PRs for all three options in case you have a preference for one or the other. Also, please let me know if I'm misunderstanding the problem here.

@mpdude
Copy link
Member

mpdude commented Mar 17, 2021

That's a valid point 👍, thanks for catching this!

I think the most straightforward way would be to use case-insensitive Regex matching with the /.../i flag. I'll commit a fix and credit you.

@mpdude mpdude closed this as completed in 4681241 Mar 17, 2021
@SeanKilleen
Copy link
Contributor Author

SeanKilleen commented Mar 17, 2021

👍 Makes sense to me; much simpler. Thanks for considering and for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants