Skip to content
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

Add support for any valid repository declaration during publication #246

Merged
merged 5 commits into from
Mar 27, 2024

Conversation

confused-Techie
Copy link
Member

Requirements

  • Filling out the template is required.

  • All new code requires tests to ensure against regressions.

    • However, if your PR contains zero code changes, feel free to select the checkmark below to indicate so.
  • Have you ran tests against this code?

  • This PR contains zero code changes.

Description of the Change

Previously the repository parameter validation was rather strict, using custom regex that would only accept a repository declared as owner/repo format. But since the parameter is taken directly from a user's package.json repository key, there's many different formats this could exist as.

To ensure we support any valid format for a repository, I've moved this parameter away from the custom regex (there is still some custom regex to validate characters used and length limits, as those aren't present in the upstream module) to instead use parse-github-url and validate what that module says are the owner and repo from the provided URL.

Additionally, with this change I've ensured the publish endpoint can support any valid repository as well with the same module.

@confused-Techie confused-Techie merged commit 2d285b9 into main Mar 27, 2024
6 checks passed
@confused-Techie confused-Techie deleted the accept-any-valid-repository branch March 27, 2024 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant