Skip to content

fix(artifacts): reject malformed remote paths#1598

Open
jbetala7 wants to merge 1 commit into
garrytan:mainfrom
jbetala7:oss/fix-1597-artifacts-url-validation
Open

fix(artifacts): reject malformed remote paths#1598
jbetala7 wants to merge 1 commit into
garrytan:mainfrom
jbetala7:oss/fix-1597-artifacts-url-validation

Conversation

@jbetala7
Copy link
Copy Markdown
Contributor

Summary

  • reject artifact remote URLs that do not contain both owner and repo path segments
  • keep valid GitHub/GitLab-style remotes working, including deeper self-hosted paths
  • add regression coverage for host-only and owner-only malformed inputs

Fixes #1597.

Root cause

parse_url() stripped .git and only checked that host and owner_repo
were non-empty. For inputs like https://github.com or
ssh://git@github.com, parameter expansion assigned github.com to both the
host and path-like value, so the helper generated bogus remotes instead of
failing.

Testing

  • bun test test/gstack-artifacts-url.test.ts
  • bun test test/gstack-artifacts-init.test.ts -t "only gh authed"
  • git diff --check

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.

gstack-artifacts-url accepts host-only and owner-only remotes as repositories

1 participant