touchlab / KMMBridge

KMMBridge is a set of Gradle tooling that facilitates publishing and consuming pre-built KMM (Kotlin Multiplatform Mobile) Xcode Framework binaries. See https://kmmbridge.touchlab.co/docs to get started.
https://kmmbridge.touchlab.co/
Apache License 2.0
340 stars 20 forks source link

[#54] Check GITHUB_REPO arg to make sure it's just owner/repo #193

Closed JuliaJakubcova closed 1 year ago

JuliaJakubcova commented 1 year ago

Issue: https://github.com/touchlab/KMMBridge/issues/54

Summary

Passing in the whole url, or presumably just the repo and not owner, will result in weird error messages.

The goal is to improve error messaging when an invalid value is passed which informs them that the input must be "Owner/Repo"

Fix

Added regex check for valid options for setting a github repo (such as url and ssh path), if regex is not matched, exception is thrown.

Testing

Tested in KmmBridgeKickStart app by calling ./gradlew kmmBridgePublish -PGITHUB_PUBLISH_TOKEN="$MY_TOKEN" -PGITHUB_REPO="https://github.com/touchlab/KMMBridgeKockStart.git" -PGITHUB_PUBLISH_USER="Touchlab-Bot" --no-daemon --stacktrace