Skip to content

fix: support slash-based branches and multi-dot filenames in URL parsing#2155

Open
lwl2005 wants to merge 2 commits into
asyncapi:masterfrom
lwl2005:master
Open

fix: support slash-based branches and multi-dot filenames in URL parsing#2155
lwl2005 wants to merge 2 commits into
asyncapi:masterfrom
lwl2005:master

Conversation

@lwl2005
Copy link
Copy Markdown

@lwl2005 lwl2005 commented May 2, 2026

Fixes #1940

Changes

1. GitHub URL Parsing - Support slash-based branches

  • Changed regex from ([^\/]+) to (.+) for branch name matching
  • Now correctly handles branches like feature/new-validation

2. File Extension Detection - Support multi-dot filenames

  • Changed name.split('.')[1] to name.includes('.') ? name.split('.').pop() : ''
  • Now correctly handles filenames like my.asyncapi.yaml (returns yaml instead of asyncapi)
  • Gracefully handles files without extensions

Testing

  • URLs like https://github.com/org/repo/blob/feature/new-validation/spec.yaml now parse correctly
  • Filenames like my.asyncapi.yaml now detect extension as yaml
  • Filenames without extensions no longer crash

lwl2005 added 2 commits May 2, 2026 11:13
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 2, 2026

⚠️ No Changeset found

Latest commit: 100e99c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

[BUG] CLI fails for GitHub URLs with slash-based branches and multi-dot spec files

1 participant