-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[core] Allow repo to be accepted as an argument for releaseTag #45801
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
Conversation
Netlify deploy previewhttps://deploy-preview-45801--material-ui.netlify.app/ Bundle size report |
scripts/releaseTag.mjs
Outdated
@@ -40,12 +42,12 @@ async function findMuiOrgRemote() { | |||
// - [email protected]:mui/material-ui.git | |||
// but not: | |||
// - [email protected]:mui/material-ui-docs.git | |||
return /mui\/material-ui(\.git)?$/.test(remote.url) && remote.method === '(push)'; | |||
return new RegExp(`mui/${repo}(.git)?$`).test(remote.url) && remote.method === '(push)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be surprised there's some hidden bugs in this regex still. My advice would be to always avoid regex if proper parsers exist. What do you think about using git-url-parse
instead? It's not a new dependency, it's already in the node_modules through lerna.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mui/${repo}(.git)?$
------------^ this is an "anything" wildcard
| mui/x-chartssgit would match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use the parser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would've also matched "not-mui/material-ui.git". 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would feel more at ease with better parsing, but ultimately up to you.
52f35c2
to
468c611
Compare
This will help in reusing this script across repos
468c611
to
a7af6ca
Compare
This will help in reusing this script across repos